-
Notifications
You must be signed in to change notification settings - Fork 124
Remove MDB_UNSIGNEDKEY, add a builder for Dbi, add MDB_INTEGERKEY comparators #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
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)
Also improve javadoc and refactor some tests to use DbiBuilder. Some tests are failing.
… key using DUPSORT
… key using DUPSORT
… key using DUPSORT
We just use the Spotify
The builders are such a significant ergonomic improvement and given we are targeting 1.0.0 it might be a good opportunity to remove those methods to encourage visibility of the new golden path.
Excellent. |
Originally I had deprecated all of the env.createDbi()
.setDbName("foo")
.withDefaultComparator()
.setDbiFlags(DbiFlags.MDB_CREATE)
.open();vs env.open("foo", DbiFlags.MDB_CREATE) // where MDB_CREATE is treated as a DbiFlagSetThe I'm not too bothered either way so happy to go with whatever you decide. |
I prefer the builder approach:
|
|
@benalexau Works for me. Builder it is. 👍 |
Fixes #249
Fixes #267
Two fixes in one PR as both need each other.