GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Iterator performance by stroomdev66 · Pull Request #270 · lmdbjava/lmdbjava

Conversation

@stroomdev66

@stroomdev66 stroomdev66 commented Nov 4, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

This is just a draft for now to show iterator performance improvements when using specific classes for cursor direction etc and removing the state machine approach.

Closes gh-269

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
at055612 and others added 27 commits March 6, 2025 16:04
@at055612
gh-249 Remove MDB_UNSIGNEDKEY, let CursorIterable call mdb_cmp
480e984
There are now essentially three ways of configuring comparators
when creating a Dbi.

**null comparator**
LMDB will use its own comparator & CursorIterable will call down
to mdb_cmp for comparisons between the current cursor key and the
range start/stop key.

**provided comparator**
LMDB will use its own comparator & CursorIterable will use the
provided comparator for comparisons between the current cursor
key and the range start/stop key.

**provided comparator with nativeCb==true**
LMDB will call back to java for all comparator duties.
CursorIterable will use the same provided comparator for
comparisons between the current cursor key and the range
start/stop key.

The methods `getSignedComparator()` and `getUnsignedComparator()`
have been made public so users of this library can access them.
@at055612
gh-249 Remove non-J8 features, use indent size 2
46f8d08
@at055612
gh-249 Fix indents
f92012e
@at055612
gh-249 Tidy code and refactor RangeComparator impls
e1756d6
@at055612
gh-249 Remove commented code
9509f6b
@at055612
gh-249 Add CursorIterableIntegerKeyTest
67e2df1
@at055612
gh-249 Remove MaskedFlag.isPropagatedToLmdb, add DbiBuilder WIP
620a89f
@at055612
Merge branch 'master' into mdb_cmp
75d87d0
@at055612
Merge branch 'master' into mdb_cmp
47b4c4f
@at055612
Add FlagSet, DbiFlagSet, PutFlagSet
bfbf223
Refactor DbiBuilder and Dbi ctor to use DbiFlagSet.
@at055612
Rename FlagSet to AbstractFlagSet
0f66aaf
@at055612
Add remaining FlagSet impls
aa000a1
Replace Env#copy(File, CopyFlags...) with copy(File, CopyFlagSet).
As there is only one flag this should not be a breaking change.

Deprecate Env#txn(Txn, TxnFlags...) as there is now
Env#txn(Txn)
Env#txn(Txn, TxnFlags)
Env#txn(Txn, TxnFlagSet)
@at055612
Fix Javadoc
667dab3
@stroomdev66
Add more cursor tests to protect against future regression
b46c916
@at055612
Replace get(Uns|S)ignedComparator with getComparator(DbiFlagSet)
0234d32
Also improve javadoc and refactor some tests to use DbiBuilder.

Some tests are failing.
@at055612
Add missing txn commit in DbiBuilder
ef0c852
@at055612
Change CursorIterableTest to use Parameterized
1b3f94d
@at055612
Deprecate methods using varargs flags
c0bbe73
@at055612
Add int key compare method to (Direct|Byte)BufferProxy
4fd89ff
@stroomdev66
Merge branch 'master' of github.com:lmdbjava/lmdbjava into more-curso…
916b441
…r-tests
@at055612
Tidy code
58dcc6e
@at055612
Fix byte order issues with compareAsIntegerKeys
26665ba
@stroomdev66
#267 Fix to establish start key when iterating backwards from a start…
dc0b96b
… key using DUPSORT
@stroomdev66
Merge branch 'master' of github.com:lmdbjava/lmdbjava into gh-267
9db91a5
@at055612
Add/refactor tests
c427801
@at055612
Merge branch 'master' into mdb_cmp
f606e7e
@stroomdev66
#269 Initial iterator performance enhancements and testing.
d6e0ca1
@stroomdev66

stroomdev66 commented Nov 4, 2025

Copy link
Copy Markdown
Collaborator Author

This is just a draft for discussion. If the approach is accepted then the current iterator would be replaced to maintain API compatability.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stroomdev66 stroomdev66 mentioned this pull request Nov 4, 2025
Improve iterator performance and add better stream support #269
Open
@codecov

codecov Bot commented Nov 4, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.86184% with 334 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.31%. Comparing base (65df2ee) to head (9541da3).
⚠️ Report is 106 commits behind head on master.

Files with missing lines Patch % Lines
src/main/java/org/lmdbjava/DirectBufferProxy.java 25.42% 42 Missing and 2 partials ⚠️
src/main/java/org/lmdbjava/Env.java 52.68% 38 Missing and 6 partials ⚠️
src/main/java/org/lmdbjava/Dbi.java 56.97% 31 Missing and 6 partials ⚠️
src/main/java/org/lmdbjava/KeyRange.java 68.68% 31 Missing ⚠️
src/main/java/org/lmdbjava/ByteBufferProxy.java 54.83% 18 Missing and 10 partials ⚠️
src/main/java/org/lmdbjava/LmdbIterable.java 82.87% 17 Missing and 8 partials ⚠️
src/main/java/org/lmdbjava/ByteArrayProxy.java 4.34% 22 Missing ⚠️
src/main/java/org/lmdbjava/ByteBufProxy.java 43.58% 18 Missing and 4 partials ⚠️
src/main/java/org/lmdbjava/LmdbStream.java 85.21% 14 Missing and 7 partials ⚠️
src/main/java/org/lmdbjava/Cursor.java 48.14% 8 Missing and 6 partials ⚠️
... and 12 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #270      +/-   ##
============================================
- Coverage     89.06%   81.31%   -7.76%     
- Complexity      413      598     +185     
============================================
  Files            32       57      +25     
  Lines          1482     2531    +1049     
  Branches        125      279     +154     
============================================
+ Hits           1320     2058     +738     
- Misses           92      336     +244     
- Partials         70      137      +67     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

at055612 added 9 commits November 6, 2025 11:31
@at055612
Improve FlagSet tests
12a9679
@at055612
Add licence header
7a6910b
@at055612
Rename buildDbi to createDbi to be consistent with Env.create()
167cdad
@at055612
Remove ByteUnits dep, add ByteUnit enum, add setMapSize() overload
d47694e
@at055612
Fix compile errors
fb08779
@at055612
Add more test coverage
a82d7f2
@at055612
Fix codeQL issue
534b76b
@at055612
Add test coverage on FlagSet
e9f9ac4
@at055612
Add tests
b0112bb
This was referenced Nov 7, 2025
Remove MDB_UNSIGNEDKEY, add a builder for Dbi, add MDB_INTEGERKEY comparators #276
Merged
Release 0.9.2? #278
Closed
at055612 and others added 18 commits November 7, 2025 10:09
@at055612
Run format plugin
c25a7d2
@at055612
Remove class separators
cf3a11e
@at055612
Run format plugin
0c97cf4
@at055612
Remove binaries accidentally added, fix test
72d4e3f
@stroomdev66
Merged new comparator code
18013fb
@at055612
Merge branch 'gh-267_plus_new_comparators' into gh-249-remove-unsigne…
6b40d0b
…dkey

Combines the fixes for gh-249 and gh-267 as they are dependant on each
other.
@at055612
Fix javadoc warnings and class visibility, fix licence warnings
48aa0fd
@at055612
Auto-format
72b5234
@at055612
Add error handling for parse(Int|Long)
dd95dea
@at055612
Remove unused code
b53378a
@at055612
Remove unused code
deb1f1b
@at055612
Remove unused hashCode methods
2bfe07c
@at055612
Change CursorIterableRangeTest to do default+native modes
a84ceaa
@at055612
Remove separator comments
a5e4cf2
@at055612
Add more tests to CursorIterableRangeTest
f8e6e07
@at055612
Remove unused test, auto format
6982aca
@stroomdev66
Merge branch 'gh-249-remove-unsignedkey' of github.com:lmdbjava/lmdbj…
6966a33
…ava into iterator-performance
@stroomdev66
Merge branch 'gh-249-remove-unsignedkey' of github.com:lmdbjava/lmdbj…
9541da3
…ava into iterator-performance

# Conflicts:
#	src/test/java/org/lmdbjava/CursorIterableIntegerDupTest.java
#	src/test/java/org/lmdbjava/CursorIterableRangeTest.java
github-advanced-security[bot]
github-advanced-security AI found potential problems Nov 10, 2025
View reviewed changes
Comment thread src/main/java/org/lmdbjava/CursorIterable.java
CursorIterable(
final Txn<T> txn, final Dbi<T> dbi, final KeyRange<T> range, final Comparator<T> comparator) {
this.cursor = dbi.openCursor(txn);
final Txn<T> txn,

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'txn' is never used.
Show autofix suggestion Hide autofix suggestion

Copilot Autofix

AI about 1 year ago

The best way to fix a useless parameter is to remove it from both the parameter list of the method and from any places where that method is called, ensuring that its absence does not break functionality. In this case, the constructor for CursorIterable in src/main/java/org/lmdbjava/CursorIterable.java takes a Txn<T> txn parameter which is never used. We should remove final Txn<T> txn from the constructor's parameter list. The constructor is not using txn, and does not store it, so no other changes within the constructor are needed.

The file changes required:

  • Remove final Txn<T> txn from the parameter list at line 48.
  • Update the parameter list to start with final Dbi<T> dbi.
  • If the constructor is called elsewhere and we can see those calls, we should update those calls to remove the first parameter (unless the surrounding context requires it). However, the context provided does not show any use/calls, so we only update the definition here.

No new methods or imports are necessary.


Suggested changeset 1
src/main/java/org/lmdbjava/CursorIterable.java
@@ -45,7 +45,6 @@
private State state = REQUIRES_INITIAL_OP;

CursorIterable(
final Txn<T> txn,
final Dbi<T> dbi,
final Cursor<T> cursor,
final KeyRange<T> range,
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
Comment thread src/main/java/org/lmdbjava/CursorIterable.java
final Txn<T> txn, final Dbi<T> dbi, final KeyRange<T> range, final Comparator<T> comparator) {
this.cursor = dbi.openCursor(txn);
final Txn<T> txn,
final Dbi<T> dbi,

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'dbi' is never used.
Show autofix suggestion Hide autofix suggestion

Copilot Autofix

AI about 1 year ago

To fix the problem, the unnecessary dbi parameter should be removed from the constructor in CursorIterable. This involves:

  • Removing final Dbi<T> dbi from the parameter list of the CursorIterable constructor.
  • Updating all usages/calls of the constructor in the provided file (if any) to remove the argument for dbi.
  • The removal must ensure that existing code functionality is retained and that the constructor still works as intended with the remaining parameters.

Since only this constructor is supplied and no usages appear within this file, only the region containing the constructor (lines 47-57) needs to be edited.


Suggested changeset 1
src/main/java/org/lmdbjava/CursorIterable.java
@@ -46,7 +46,6 @@

CursorIterable(
final Txn<T> txn,
final Dbi<T> dbi,
final Cursor<T> cursor,
final KeyRange<T> range,
final RangeComparator rangeComparator) {
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
Comment thread src/main/java/org/lmdbjava/LmdbStream.java
}

private static <T> Comparator<KeyVal<T>> createEntryComparator(
final RangeComparator rangeComparator) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'rangeComparator' is never used.
Show autofix suggestion Hide autofix suggestion

Copilot Autofix

AI about 1 year ago

To fix the problem, the useless parameter rangeComparator should be removed from the method signature of createEntryComparator. Specifically, this means changing both the method declaration and any usages/calls of this method within the file to remove the argument. In the file src/main/java/org/lmdbjava/LmdbStream.java, locate the method starting on line 164, change its signature to remove the parameter, and ensure no rangeComparator argument is passed in calls to createEntryComparator. If there are calls in the code we've seen (e.g., in createSpliterator or constructors), update those call sites. Only change visible code.


Suggested changeset 1
src/main/java/org/lmdbjava/LmdbStream.java
  • Copy modified line R164
@@ -161,8 +161,7 @@
}
}

private static <T> Comparator<KeyVal<T>> createEntryComparator(
final RangeComparator rangeComparator) {
private static <T> Comparator<KeyVal<T>> createEntryComparator() {
return null;
// return (o1, o2) -> comparator.compare(o1.key(), o2.key());
}
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
Comment thread src/main/java/org/lmdbjava/LmdbStream.java
}

private static <T> Comparator<KeyVal<T>> createReversedEntryComparator(
final RangeComparator rangeComparator) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'rangeComparator' is never used.
Show autofix suggestion Hide autofix suggestion

Copilot Autofix

AI about 1 year ago

To resolve this, remove the unused rangeComparator parameter from the createReversedEntryComparator method in LmdbStream.java. Also, update every location where this method is called to no longer pass a rangeComparator argument. Within the snippet you provided, direct usages are not shown, so, per instruction, only the method declaration should be altered, and the parameter should be removed from both the signature and invocation if shown. No imports or method definitions are required for this minor change.

Suggested changeset 1
src/main/java/org/lmdbjava/LmdbStream.java
  • Copy modified line R170
@@ -167,8 +167,7 @@
// return (o1, o2) -> comparator.compare(o1.key(), o2.key());
}

private static <T> Comparator<KeyVal<T>> createReversedEntryComparator(
final RangeComparator rangeComparator) {
private static <T> Comparator<KeyVal<T>> createReversedEntryComparator() {
return null;
// return (o1, o2) -> comparator.compare(o1.key(), o2.key());
}
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
Comment thread src/test/java/org/lmdbjava/CopyFlagSetTest.java
import java.util.List;
import java.util.stream.Collectors;

class CopyFlagSetTest extends AbstractFlagSetTest<CopyFlags, CopyFlagSet> {

Check notice

Code scanning / CodeQL

Unused classes and interfaces Note test

Unused class: CopyFlagSetTest is not referenced within this codebase. If not used as an external API it should be removed.

Copilot Autofix

AI about 1 year ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

Comment thread src/test/java/org/lmdbjava/DbiFlagSetTest.java
import java.util.List;
import java.util.stream.Collectors;

class DbiFlagSetTest extends AbstractFlagSetTest<DbiFlags, DbiFlagSet> {

Check notice

Code scanning / CodeQL

Unused classes and interfaces Note test

Unused class: DbiFlagSetTest is not referenced within this codebase. If not used as an external API it should be removed.
Show autofix suggestion Hide autofix suggestion

Copilot Autofix

AI about 1 year ago

The best way to fix this problem is to remove the unused class DbiFlagSetTest entirely from the source file src/test/java/org/lmdbjava/DbiFlagSetTest.java. This means deleting its definition. If the whole file only contains this class and it is not referenced elsewhere or required by any testing framework, removing the entire file is even better. If this file contains only the code shown, delete all lines in the file.


Suggested changeset 1
src/test/java/org/lmdbjava/DbiFlagSetTest.java
@@ -1,59 +1 @@
/*
* Copyright © 2016-2025 The LmdbJava Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.lmdbjava;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;

class DbiFlagSetTest extends AbstractFlagSetTest<DbiFlags, DbiFlagSet> {

@Override
List<DbiFlags> getAllFlags() {
return Arrays.stream(DbiFlags.values()).collect(Collectors.toList());
}

@Override
DbiFlagSet getEmptyFlagSet() {
return DbiFlagSet.empty();
}

@Override
AbstractFlagSet.Builder<DbiFlags, DbiFlagSet> getBuilder() {
return DbiFlagSet.builder();
}

@Override
Class<DbiFlags> getFlagType() {
return DbiFlags.class;
}

@Override
DbiFlagSet getFlagSet(Collection<DbiFlags> flags) {
return DbiFlagSet.of(flags);
}

@Override
DbiFlagSet getFlagSet(DbiFlags[] flags) {
return DbiFlagSet.of(flags);
}

@Override
DbiFlagSet getFlagSet(DbiFlags flag) {
return DbiFlagSet.of(flag);
}
}
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
Comment thread src/test/java/org/lmdbjava/EnvFlagSetTest.java
import java.util.List;
import java.util.stream.Collectors;

class EnvFlagSetTest extends AbstractFlagSetTest<EnvFlags, EnvFlagSet> {

Check notice

Code scanning / CodeQL

Unused classes and interfaces Note test

Unused class: EnvFlagSetTest is not referenced within this codebase. If not used as an external API it should be removed.
Show autofix suggestion Hide autofix suggestion

Copilot Autofix

AI about 1 year ago

To fix the unused class issue, the best approach is to remove the entire EnvFlagSetTest class from the file. This involves deleting all lines pertaining to the class definition: line 23 through 59 (inclusive) in src/test/java/org/lmdbjava/EnvFlagSetTest.java. This resolves the issue by eliminating the maintenance burden of an unused class and reducing clutter in the codebase.

Suggested changeset 1
src/test/java/org/lmdbjava/EnvFlagSetTest.java
@@ -20,40 +20,4 @@
import java.util.List;
import java.util.stream.Collectors;

class EnvFlagSetTest extends AbstractFlagSetTest<EnvFlags, EnvFlagSet> {

@Override
List<EnvFlags> getAllFlags() {
return Arrays.stream(EnvFlags.values()).collect(Collectors.toList());
}

@Override
EnvFlagSet getEmptyFlagSet() {
return EnvFlagSet.empty();
}

@Override
AbstractFlagSet.Builder<EnvFlags, EnvFlagSet> getBuilder() {
return EnvFlagSet.builder();
}

@Override
EnvFlagSet getFlagSet(Collection<EnvFlags> flags) {
return EnvFlagSet.of(flags);
}

@Override
EnvFlagSet getFlagSet(EnvFlags[] flags) {
return EnvFlagSet.of(flags);
}

@Override
EnvFlagSet getFlagSet(EnvFlags flag) {
return EnvFlagSet.of(flag);
}

@Override
Class<EnvFlags> getFlagType() {
return EnvFlags.class;
}
}
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
Comment thread src/test/java/org/lmdbjava/LmdbIterableRangeTest.java
.setEnvFlags(MDB_NOSUBDIR)
.open(file)) {
final Dbi<ByteBuffer> dbi =
env.openDbi(DB_1, comparator, nativeCb, flags.toArray(new DbiFlags[0]));

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Error loading related location
Loading

Uh oh!

There was an error while loading. Please reload this page.

should be avoided because it has been deprecated.
Show autofix suggestion Hide autofix suggestion

Copilot Autofix

AI about 1 year ago

To fix the Deprecated method or constructor invocation, we should replace the call to the deprecated env.openDbi(DB_1, comparator, nativeCb, flags.toArray(new DbiFlags[0])). The LmdbJava Env class provides several overloaded versions of openDbi. The deprecated version typically combines comparator and nativeCb arguments, but newer versions require passing either a comparator OR using the nativeCb flag, not both. According to standard migration in LmdbJava, the newer method is likely openDbi(String name, Comparator<ByteBuffer> comparator, DbiFlags... flags) if a comparator is provided, or openDbi(String name, DbiFlags... flags) otherwise. The boolean nativeCb argument has been removed in newer APIs.

Therefore, the recommended fix is:

  • If comparator is not null, use env.openDbi(DB_1, comparator, ...) with flags.
  • If comparator is null, use env.openDbi(DB_1, ...) with flags only.

Since the function signature always provides a comparator (whose value is variable), we need to check its value. The replacement involves changing line 187 in testCSV() to:

final Dbi<ByteBuffer> dbi = comparator != null
    ? env.openDbi(DB_1, comparator, flags.toArray(new DbiFlags[0]))
    : env.openDbi(DB_1, flags.toArray(new DbiFlags[0]));

This edit ensures backward compatibility and uses the modern recommended overload.

No additional imports or dependencies are required as we are using existing core APIs.


Suggested changeset 1
src/test/java/org/lmdbjava/LmdbIterableRangeTest.java
  • Copy modified lines R187-R189
@@ -184,7 +184,9 @@
.setEnvFlags(MDB_NOSUBDIR)
.open(file)) {
final Dbi<ByteBuffer> dbi =
env.openDbi(DB_1, comparator, nativeCb, flags.toArray(new DbiFlags[0]));
comparator != null
? env.openDbi(DB_1, comparator, flags.toArray(new DbiFlags[0]))
: env.openDbi(DB_1, flags.toArray(new DbiFlags[0]));
dbPopulator.accept(env, dbi);
try (final Writer writer = new StringWriter()) {
final KeyRangeType keyRangeType = KeyRangeType.valueOf(keyType.trim());
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
Comment thread src/test/java/org/lmdbjava/LmdbStreamRangeTest.java
.setEnvFlags(MDB_NOSUBDIR)
.open(file)) {
final Dbi<ByteBuffer> dbi =
env.openDbi(DB_1, comparator, nativeCb, flags.toArray(new DbiFlags[0]));

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Error loading related location
Loading

Uh oh!

There was an error while loading. Please reload this page.

should be avoided because it has been deprecated.
Show autofix suggestion Hide autofix suggestion

Copilot Autofix

AI about 1 year ago

To fix this error, replace the deprecated env.openDbi(DB_1, comparator, nativeCb, flags.toArray(new DbiFlags[0])) call with the recommended, non-deprecated API for opening a database in LmdbJava. The current recommended method is typically env.openDbi(DB_1, DbiFlags...) without extra arguments, or using a builder/configurable pattern to specify comparators and native callbacks if available.

However, your code needs to specify a Comparator<ByteBuffer>, a native callback flag, and pass flags as an array. In recent LmdbJava versions, the recommended approach is to use the Dbi.Builder, chain the desired configuration, and call build() or open().

Therefore, the fix in testCSV is to refactor line 179 as follows:

  • Use env.openDbi() or env.dbiBuilder(); configure the comparator and flags through the builder API.
  • If a native callback is required, use the builder's method for setting it, or note that the comparator will act as a native comparator if appropriate.
  • Pass the flags as a varargs (directly).
  • Remove the deprecated multi-argument method.

Required changes:

  • Replace line 179 with code that uses the builder (env.dbiBuilder(DB_1)) to set the comparator and flags.
  • Call build() or open() to obtain the configured Dbi.
  • No additional imports are needed if builder API is already available; otherwise, if unavailable, use the recommended open method that accepts the arguments.

Suggested changeset 1
src/test/java/org/lmdbjava/LmdbStreamRangeTest.java
  • Copy modified lines R179-R183
@@ -176,7 +176,11 @@
.setEnvFlags(MDB_NOSUBDIR)
.open(file)) {
final Dbi<ByteBuffer> dbi =
env.openDbi(DB_1, comparator, nativeCb, flags.toArray(new DbiFlags[0]));
env.dbiBuilder(DB_1)
.withComparator(comparator)
.withNativeComparator(nativeCb)
.withFlags(flags.toArray(new DbiFlags[0]))
.build();
dbPopulator.accept(env, dbi);
try (final Writer writer = new StringWriter()) {
final KeyRangeType keyRangeType = KeyRangeType.valueOf(keyType.trim());
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
Comment thread src/test/java/org/lmdbjava/TxnFlagSetTest.java
import java.util.List;
import java.util.stream.Collectors;

class TxnFlagSetTest extends AbstractFlagSetTest<TxnFlags, TxnFlagSet> {

Check notice

Code scanning / CodeQL

Unused classes and interfaces Note test

Unused class: TxnFlagSetTest is not referenced within this codebase. If not used as an external API it should be removed.

Copilot Autofix

AI about 1 year ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bp-alex bp-alex Awaiting requested review from bp-alex

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Improve iterator performance and add better stream support

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@stroomdev66 @github-advanced-security @at055612
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.