Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-249 Remove MDB_UNSIGNEDKEY, let CursorIterable call mdb_cmp#250

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
at055612 wants to merge7 commits intolmdbjava:master
base:master
Choose a base branch
Loading
fromat055612:mdb_cmp

Conversation

at055612
Copy link
Contributor

Fixes#249

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 methodsgetSignedComparator() andgetUnsignedComparator() have been made public so users of this library can access them.

There are now essentially three ways of configuring comparatorswhen creating a Dbi.**null comparator**LMDB will use its own comparator & CursorIterable will call downto mdb_cmp for comparisons between the current cursor key and therange start/stop key.**provided comparator**LMDB will use its own comparator & CursorIterable will use theprovided comparator for comparisons between the current cursorkey 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 forcomparisons between the current cursor key and the rangestart/stop key.The methods `getSignedComparator()` and `getUnsignedComparator()`have been made public so users of this library can access them.
@codecovCodecov
Copy link

codecovbot commentedMar 6, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is59.52381% with68 lines in your changes missing coverage. Please review.

Project coverage is 86.75%. Comparing base(154df33) to head(620a89f).

Files with missing linesPatch %Lines
src/main/java/org/lmdbjava/DbiBuilder.java0.00%60 Missing⚠️
src/main/java/org/lmdbjava/Key.java73.68%4 Missing and 1 partial⚠️
src/main/java/org/lmdbjava/CursorIterable.java95.00%2 Missing⚠️
src/main/java/org/lmdbjava/Env.java66.66%1 Missing⚠️
Additional details and impacted files
@@             Coverage Diff              @@##             master     #250      +/-   ##============================================- Coverage     88.25%   86.75%   -1.50%- Complexity      408      415       +7============================================  Files            32       34       +2       Lines          1456     1563     +107       Branches        124      136      +12     ============================================+ Hits           1285     1356      +71- Misses          101      138      +37+ Partials         70       69       -1

☔ View full report in Codecov by Sentry.
📢 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.

cnt++;
}
}
final Duration duration = Duration.between(start, Instant.now());

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'KeyVal kv' is never read.
populateList();
try (Txn<ByteBuffer> txn = env.txnRead();
CursorIterable<ByteBuffer> c = db.iterate(txn)) {

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'int cnt' is never read.

try (Txn<ByteBuffer> txn = env.txnRead();
CursorIterable<ByteBuffer> c = db.iterate(txn, keyRange)) {
for (final CursorIterable.KeyVal<ByteBuffer> kv : c) {

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'int val' is never read.
public void iterate() {
for (final Dbi<ByteBuffer> db : dbs) {
populateList();
try (Txn<ByteBuffer> txn = env.txnRead();

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'int cnt' is never read.
KeyRange<ByteBuffer> keyRange = KeyRange.atLeastBackward(startKeyBuf);

try (Txn<ByteBuffer> txn = env.txnRead();
CursorIterable<ByteBuffer> c = db.iterate(txn, keyRange)) {

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'int val' is never read.
return this;
}

/**

Check notice

Code scanning / CodeQL

Possible confusion of local and field Note

Confusing name: method
open
Loading
also refers to field
txn
Loading
(without qualifying it with 'this').
dbJavaComparator = env.openDbi(DB_1,
bufferProxy.getUnsignedComparator(),
MDB_CREATE,
MDB_INTEGERKEY);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Loading
should be avoided because it has been deprecated.
MDB_CREATE,
MDB_INTEGERKEY);
// Use LMDB comparator for start/stop keys
dbLmdbComparator = env.openDbi(DB_2, MDB_CREATE, MDB_INTEGERKEY);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Loading
should be avoided because it has been deprecated.
dbLmdbComparator = env.openDbi(DB_2, MDB_CREATE, MDB_INTEGERKEY);
// Use a java comparator for start/stop keys and as a callback comparaotr
dbCallbackComparator = env.openDbi(DB_3,
bufferProxy.getUnsignedComparator(),

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Loading
should be avoided because it has been deprecated.
bb1.get(array1);
bb2.get(array2);
bb1.reset();
bb2.reset();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Loading
should be avoided because it has been deprecated.
dbJavaComparator =
env.openDbi("JavaComparator", bufferProxy.getUnsignedComparator(), MDB_CREATE);
// Use LMDB comparator for start/stop keys
dbLmdbComparator = env.openDbi("LmdbComparator", MDB_CREATE);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Loading
should be avoided because it has been deprecated.
dbLmdbComparator = env.openDbi("LmdbComparator", MDB_CREATE);
// Use a java comparator for start/stop keys and as a callback comparator
dbCallbackComparator =
env.openDbi("CallBackComparator", bufferProxy.getUnsignedComparator(), true, MDB_CREATE);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Loading
should be avoided because it has been deprecated.
populateDatabase(db);

// Use a java comparator for start/stop keys only
dbJavaComparator = env.openDbi(DB_1, bufferProxy.getUnsignedComparator(), MDB_CREATE);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Loading
should be avoided because it has been deprecated.
// Use a java comparator for start/stop keys only
dbJavaComparator = env.openDbi(DB_1, bufferProxy.getUnsignedComparator(), MDB_CREATE);
// Use LMDB comparator for start/stop keys
dbLmdbComparator = env.openDbi(DB_2, MDB_CREATE);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Loading
should be avoided because it has been deprecated.
// Use LMDB comparator for start/stop keys
dbLmdbComparator = env.openDbi(DB_2, MDB_CREATE);
// Use a java comparator for start/stop keys and as a callback comparaotr
dbCallbackComparator = env.openDbi(DB_3, bufferProxy.getUnsignedComparator(), true, MDB_CREATE);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Env.openDbi
Loading
should be avoided because it has been deprecated.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

The newMDB_UNSIGNEDKEY DbiFlag should probably be the default behaviour
1 participant
@at055612

[8]ページ先頭

©2009-2025 Movatter.jp