Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class LmdbContextIdIterator implements Closeable {

private final long txn;

private final int dbi;

private volatile boolean closed = false;

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

private ByteBuffer minKeyBuf;

private int lastResult;

private final long[] record = new long[1];

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

this.dbi = dbi;
this.txnRef = txnRef;
this.txnLockManager = txnRef.lockManager();

Expand Down Expand Up @@ -102,6 +97,7 @@ public long[] next() {
throw new SailException(e);
}
try {
int lastResult;
if (txnRefVersion != txnRef.version()) {
// cursor must be renewed
E(mdb_cursor_renew(txn, cursor));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ class LmdbRecordIterator implements RecordIterator {

private ByteBuffer maxKeyBuf;

private int lastResult;

private final long[] quad;
private final long[] originalQuad;

Expand Down Expand Up @@ -153,6 +151,7 @@ public long[] next() {
return null;
}

int lastResult;
if (txnRefVersion != txnRef.version()) {
// TODO: None of the tests in the LMDB Store cover this case!
// cursor must be renewed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class LmdbSailStore implements SailStore {
*
* @param <T> Type of elements within this buffer
*/
final class CircularBuffer<T> {
static final class CircularBuffer<T> {

private final T[] elements;
private volatile int head = 0;
Expand Down Expand Up @@ -139,7 +139,6 @@ interface Operation {
class AddQuadOperation implements Operation {
long s, p, o, c;
boolean explicit;
Resource context;

@Override
public void execute() throws IOException {
Expand Down Expand Up @@ -600,7 +599,6 @@ public void approveAll(Set<Statement> approved, Set<Resource> approvedContexts)
q.p = valueStore.storeValue(pred);
q.o = valueStore.storeValue(obj);
q.c = context == null ? 0 : valueStore.storeValue(context);
q.context = context;
q.explicit = explicit;

if (multiThreadingActive) {
Expand Down Expand Up @@ -744,7 +742,6 @@ private void addStatement(Resource subj, IRI pred, Value obj, boolean explicit,
q.p = valueStore.storeValue(pred);
q.o = valueStore.storeValue(obj);
q.c = context == null ? 0 : valueStore.storeValue(context);
q.context = context;
q.explicit = explicit;

if (multiThreadingActive) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@
abstract class MemoryOverflowModel extends AbstractMemoryOverflowModel<SailSourceModel> {

final Logger logger = LoggerFactory.getLogger(MemoryOverflowModel.class);
private final boolean verifyAdditions;

private transient File dataDir;

private transient LmdbSailStore store;

public MemoryOverflowModel(boolean verifyAdditions) {
super();
this.verifyAdditions = verifyAdditions;
}

protected abstract LmdbSailStore createSailStore(File dataDir) throws IOException, SailException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class PersistentSet<T extends Serializable> extends AbstractSet<T> {

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

private PersistentSetFactory<T> factory;
private final PersistentSetFactory<T> factory;
private final int dbi;
private int size;

Expand Down Expand Up @@ -192,7 +192,7 @@ private class ElementIterator implements Iterator<T> {

private final StampedLongAdderLockManager txnLockManager;
private Txn txnRef;
private long txnRefVersion;
private final long txnRefVersion;

private T next;
private T current;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PersistentSetFactory<T extends Serializable> {
TxnManager txnManager;
long writeTxn;
PointerBuffer writeTxnPp = PointerBuffer.allocateDirect(1);
private int defaultDbi;
private final int defaultDbi;
private long mapSize = 1048576; // 1 MiB
private long pageSize;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ class TripleStore implements Closeable {
private final ValueStore valueStore;

private long env;
private int contextsDbi;
private final int contextsDbi;
private int pageSize;
private final boolean forceSync;
private final boolean autoGrow;
private long mapSize;
private long writeTxn;
Expand Down Expand Up @@ -196,7 +195,7 @@ public int compareRegion(ByteBuffer array1, int startIdx1, ByteBuffer array2, in

TripleStore(File dir, LmdbStoreConfig config, ValueStore valueStore) throws IOException, SailException {
this.dir = dir;
this.forceSync = config.getForceSync();
boolean forceSync = config.getForceSync();
this.autoGrow = config.getAutoGrow();
this.valueStore = valueStore;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ enum Mode {

class Txn implements Closeable, AutoCloseable {

private long txn;
private final long txn;
private long version;

Txn(long txn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,9 @@ protected class RecordCacheIterator {
private final MDBVal valueData = MDBVal.malloc();
private long txn;
private final long cursor;
private final int dbi;
private final long[] quad = new long[4];

protected RecordCacheIterator(int dbi) throws IOException {
this.dbi = dbi;
try (MemoryStack stack = MemoryStack.stackPush()) {
PointerBuffer pp = stack.mallocPointer(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,6 @@ LmdbValue cachedValue(long id) {
return null;
}

long prevId;
long prevPrevId;

/**
* Cache value by ID.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public GroupMatcher(byte[] valueArray, boolean[] shouldMatch) {
this.cmp0 = Bytes.capturedComparator(valueArray, 0, len);
} else {
this.cmp0 = NULL_REGION_COMPARATOR;
;
}

baseOffset += len;
Expand Down
Loading