Skip to content

Commit dda6f6f

Browse files
authored
Merge main into develop (#5602)
2 parents 55e7827 + 99978e2 commit dda6f6f

11 files changed

Lines changed: 9 additions & 26 deletions

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbContextIdIterator.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ class LmdbContextIdIterator implements Closeable {
4545

4646
private final long txn;
4747

48-
private final int dbi;
49-
5048
private volatile boolean closed = false;
5149

5250
private final MDBVal keyData;
@@ -55,8 +53,6 @@ class LmdbContextIdIterator implements Closeable {
5553

5654
private ByteBuffer minKeyBuf;
5755

58-
private int lastResult;
59-
6056
private final long[] record = new long[1];
6157

6258
private boolean fetchNext = false;
@@ -70,7 +66,6 @@ class LmdbContextIdIterator implements Closeable {
7066
this.keyData = pool.getVal();
7167
this.valueData = pool.getVal();
7268

73-
this.dbi = dbi;
7469
this.txnRef = txnRef;
7570
this.txnLockManager = txnRef.lockManager();
7671

@@ -102,6 +97,7 @@ public long[] next() {
10297
throw new SailException(e);
10398
}
10499
try {
100+
int lastResult;
105101
if (txnRefVersion != txnRef.version()) {
106102
// cursor must be renewed
107103
E(mdb_cursor_renew(txn, cursor));

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbRecordIterator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ class LmdbRecordIterator implements RecordIterator {
7575

7676
private ByteBuffer maxKeyBuf;
7777

78-
private int lastResult;
79-
8078
private final long[] quad;
8179
private final long[] originalQuad;
8280

@@ -153,6 +151,7 @@ public long[] next() {
153151
return null;
154152
}
155153

154+
int lastResult;
156155
if (txnRefVersion != txnRef.version()) {
157156
// TODO: None of the tests in the LMDB Store cover this case!
158157
// cursor must be renewed

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbSailStore.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class LmdbSailStore implements SailStore {
8383
*
8484
* @param <T> Type of elements within this buffer
8585
*/
86-
final class CircularBuffer<T> {
86+
static final class CircularBuffer<T> {
8787

8888
private final T[] elements;
8989
private volatile int head = 0;
@@ -139,7 +139,6 @@ interface Operation {
139139
class AddQuadOperation implements Operation {
140140
long s, p, o, c;
141141
boolean explicit;
142-
Resource context;
143142

144143
@Override
145144
public void execute() throws IOException {
@@ -600,7 +599,6 @@ public void approveAll(Set<Statement> approved, Set<Resource> approvedContexts)
600599
q.p = valueStore.storeValue(pred);
601600
q.o = valueStore.storeValue(obj);
602601
q.c = context == null ? 0 : valueStore.storeValue(context);
603-
q.context = context;
604602
q.explicit = explicit;
605603

606604
if (multiThreadingActive) {
@@ -744,7 +742,6 @@ private void addStatement(Resource subj, IRI pred, Value obj, boolean explicit,
744742
q.p = valueStore.storeValue(pred);
745743
q.o = valueStore.storeValue(obj);
746744
q.c = context == null ? 0 : valueStore.storeValue(context);
747-
q.context = context;
748745
q.explicit = explicit;
749746

750747
if (multiThreadingActive) {

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/MemoryOverflowModel.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@
3131
abstract class MemoryOverflowModel extends AbstractMemoryOverflowModel<SailSourceModel> {
3232

3333
final Logger logger = LoggerFactory.getLogger(MemoryOverflowModel.class);
34-
private final boolean verifyAdditions;
3534

3635
private transient File dataDir;
3736

3837
private transient LmdbSailStore store;
3938

4039
public MemoryOverflowModel(boolean verifyAdditions) {
4140
super();
42-
this.verifyAdditions = verifyAdditions;
4341
}
4442

4543
protected abstract LmdbSailStore createSailStore(File dataDir) throws IOException, SailException;

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/PersistentSet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class PersistentSet<T extends Serializable> extends AbstractSet<T> {
5656

5757
private static final Logger logger = LoggerFactory.getLogger(PersistentSet.class);
5858

59-
private PersistentSetFactory<T> factory;
59+
private final PersistentSetFactory<T> factory;
6060
private final int dbi;
6161
private int size;
6262

@@ -192,7 +192,7 @@ private class ElementIterator implements Iterator<T> {
192192

193193
private final StampedLongAdderLockManager txnLockManager;
194194
private Txn txnRef;
195-
private long txnRefVersion;
195+
private final long txnRefVersion;
196196

197197
private T next;
198198
private T current;

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/PersistentSetFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class PersistentSetFactory<T extends Serializable> {
5555
TxnManager txnManager;
5656
long writeTxn;
5757
PointerBuffer writeTxnPp = PointerBuffer.allocateDirect(1);
58-
private int defaultDbi;
58+
private final int defaultDbi;
5959
private long mapSize = 1048576; // 1 MiB
6060
private long pageSize;
6161

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/TripleStore.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,8 @@ class TripleStore implements Closeable {
163163
private final ValueStore valueStore;
164164

165165
private long env;
166-
private int contextsDbi;
166+
private final int contextsDbi;
167167
private int pageSize;
168-
private final boolean forceSync;
169168
private final boolean autoGrow;
170169
private long mapSize;
171170
private long writeTxn;
@@ -196,7 +195,7 @@ public int compareRegion(ByteBuffer array1, int startIdx1, ByteBuffer array2, in
196195

197196
TripleStore(File dir, LmdbStoreConfig config, ValueStore valueStore) throws IOException, SailException {
198197
this.dir = dir;
199-
this.forceSync = config.getForceSync();
198+
boolean forceSync = config.getForceSync();
200199
this.autoGrow = config.getAutoGrow();
201200
this.valueStore = valueStore;
202201

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/TxnManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ enum Mode {
162162

163163
class Txn implements Closeable, AutoCloseable {
164164

165-
private long txn;
165+
private final long txn;
166166
private long version;
167167

168168
Txn(long txn) {

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/TxnRecordCache.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,9 @@ protected class RecordCacheIterator {
179179
private final MDBVal valueData = MDBVal.malloc();
180180
private long txn;
181181
private final long cursor;
182-
private final int dbi;
183182
private final long[] quad = new long[4];
184183

185184
protected RecordCacheIterator(int dbi) throws IOException {
186-
this.dbi = dbi;
187185
try (MemoryStack stack = MemoryStack.stackPush()) {
188186
PointerBuffer pp = stack.mallocPointer(1);
189187

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/ValueStore.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,6 @@ LmdbValue cachedValue(long id) {
493493
return null;
494494
}
495495

496-
long prevId;
497-
long prevPrevId;
498-
499496
/**
500497
* Cache value by ID.
501498
* <p>

0 commit comments

Comments
 (0)