| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
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 fmt-maven-plugin which implements the Google Java Style (which is prescriptive and has no configuration options). I used to use PMD and Checkstyle on LmdbJava but I found it problematic because (a) every update would introduce new warnings which had to be suppressed for no apparent benefit and (b) they reflect options which are debatable at best and impeded people who wanted to provide PRs. I think the code formatter's prescriptive and automated approach strikes the right balance.
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. |
Sorry, something went wrong.
|
@benalexau
Originally I had deprecated all of the open( methods so the only route for Dbi creation was the builder, however I then started to think that for the simplest cases where you just want a named db with no special options, it would be worthwhile to keep the simplest of the open methods. i.e. 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 open(byte[], DbiFlagSet) variant can probably just be done via the builder as that seems like a less common use case. I'm not too bothered either way so happy to go with whatever you decide. |
Sorry, something went wrong.
I prefer the builder approach:
|
Sorry, something went wrong.
|
@benalexau Works for me. Builder it is. 👍 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #249
Fixes #267
Two fixes in one PR as both need each other.