GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-249 Remove MDB_UNSIGNEDKEY, let CursorIterable call mdb_cmp by at055612 · Pull Request #250 · lmdbjava/lmdbjava Conversation
Collaborator
Fixes #249 There are now essentially three ways of configuring comparators when creating a Dbi. null comparator provided comparator provided comparator with nativeCb==true The methods
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsThere 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.
|
There was an error while loading. Please reload this page.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@ ## master #250 +/- ## ============================================ - Coverage 89.06% 85.06% -4.01% - Complexity 413 507 +94 ============================================ Files 32 41 +9 Lines 1482 1962 +480 Branches 125 180 +55 ============================================ + Hits 1320 1669 +349 - Misses 92 177 +85 - Partials 70 116 +46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| cnt++; | ||
| } | ||
| } | ||
| final Duration duration = Duration.between(start, Instant.now()); |
Code scanning / CodeQL
Unread local variable Note test
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| bb1.get(array1); | ||
| bb2.get(array2); | ||
| bb1.reset(); | ||
| bb2.reset(); |
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
5e03aec to
e598e21
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Refactor DbiBuilder and Dbi ctor to use DbiFlagSet.
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)
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Also improve javadoc and refactor some tests to use DbiBuilder. Some tests are failing.
There was an error while loading. Please reload this page.
| if (txn != null) { | ||
| return open(txn, dbiBuilder); | ||
| } else { | ||
| try (final Txn<T> txn = getTxn(dbiBuilder)) { |
Code scanning / CodeQL
Possible confusion of local and field Note
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| /** | ||
| * @return The {@link Iterator} (in no particular order) for the flags in this {@link FlagSet}. | ||
| */ | ||
| default Iterator<T> iterator() { |
Code scanning / CodeQL
Missing Override annotation Note
There was an error while loading. Please reload this page.
| try (Txn<ByteBuffer> txn = env.txnWrite(); | ||
| final Cursor<ByteBuffer> cursor = db.openCursor(txn)) { | ||
| while (cursor.next()) { | ||
| cursor.delete(); |
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| final long[] values = random.longs(5_000_000).toArray(); | ||
|
|
||
| Instant time = Instant.now(); | ||
| int x = 0; |
Code scanning / CodeQL
Unread local variable Note test
| bb2.reset(); | ||
| return guava.compare(array1, array2); | ||
| }; | ||
| final Dbi<ByteBuffer> guavaDbi = env.openDbi(DB_1, comparator, MDB_CREATE); |
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
There was an error while loading. Please reload this page.
| create(bufferProxy) | ||
| .setMapSize(KIBIBYTES.toBytes(256)) | ||
| .setMaxReaders(1) | ||
| .setMaxDbs(3) | ||
| .open(file.toFile(), POSIX_MODE, MDB_NOSUBDIR); |
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
There was an error while loading. Please reload this page.
| try (Txn<ByteBuffer> txn = env.txnRead()) { | ||
| try (CursorIterable<ByteBuffer> iterable = db.iterate(txn)) { | ||
| for (KeyVal<ByteBuffer> keyVal : iterable) { | ||
| final String val = getString(keyVal.val()); |
Code scanning / CodeQL
Unread local variable Note test
| try (CursorIterable<ByteBuffer> iterable = db.iterate(txn)) { | ||
| for (KeyVal<ByteBuffer> keyVal : iterable) { | ||
| final String val = getString(keyVal.val()); | ||
| final long key = getNativeLong(keyVal.key()); |
Code scanning / CodeQL
Unread local variable Note test
| for (KeyVal<ByteBuffer> keyVal : iterable) { | ||
| final String val = getString(keyVal.val()); | ||
| final long key = getNativeLong(keyVal.key()); | ||
| final int remaining = keyVal.key().remaining(); |
Code scanning / CodeQL
Unread local variable Note test
| create(bufferProxy) | ||
| .setMapSize(GIBIBYTES.toBytes(1)) | ||
| .setMaxReaders(1) | ||
| .setMaxDbs(3) | ||
| .open(file.toFile(), POSIX_MODE, MDB_NOSUBDIR); |
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
There was an error while loading. Please reload this page.
|
Closing this as the changes have been moved to PR #276 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
The newMDB_UNSIGNEDKEY DbiFlag should probably be the default behaviour
There was an error while loading. Please reload this page.