Remove unused constants
This commit is contained in:
parent
db9b1bb7fb
commit
e48f8b25eb
@ -17,9 +17,6 @@ import org.lmdbjava.Txn;
|
||||
|
||||
public class LMDBArray<V> implements IArray<V>, Closeable {
|
||||
|
||||
private static final boolean FORCE_SYNC = false;
|
||||
private static final boolean DONT_MERGE_TXNS = true;
|
||||
|
||||
private static final AtomicLong NEXT_LMDB_ARRAY_ID = new AtomicLong(0);
|
||||
|
||||
private final AtomicBoolean closed = new AtomicBoolean();
|
||||
@ -43,11 +40,7 @@ public class LMDBArray<V> implements IArray<V>, Closeable {
|
||||
this.defaultValue = defaultValue;
|
||||
|
||||
this.writing = true;
|
||||
if (DONT_MERGE_TXNS) {
|
||||
this.rwTxn = null;
|
||||
} else {
|
||||
this.rwTxn = this.env.txnWrite();
|
||||
}
|
||||
this.rwTxn = null;
|
||||
this.readTxn = null;
|
||||
this.virtualSize = size;
|
||||
}
|
||||
@ -80,10 +73,6 @@ public class LMDBArray<V> implements IArray<V>, Closeable {
|
||||
rwTxn.close();
|
||||
rwTxn = null;
|
||||
}
|
||||
if (FORCE_SYNC) {
|
||||
env.sync(true);
|
||||
}
|
||||
assert rwTxn == null;
|
||||
assert readTxn == null;
|
||||
readTxn = env.txnRead();
|
||||
}
|
||||
@ -91,20 +80,17 @@ public class LMDBArray<V> implements IArray<V>, Closeable {
|
||||
}
|
||||
|
||||
private void endMode() {
|
||||
if (DONT_MERGE_TXNS) {
|
||||
writing = true;
|
||||
if (readTxn != null) {
|
||||
readTxn.commit();
|
||||
readTxn.close();
|
||||
readTxn = null;
|
||||
}
|
||||
if (rwTxn != null) {
|
||||
rwTxn.commit();
|
||||
rwTxn.close();
|
||||
rwTxn = null;
|
||||
}
|
||||
writing = true;
|
||||
if (readTxn != null) {
|
||||
readTxn.commit();
|
||||
readTxn.close();
|
||||
readTxn = null;
|
||||
}
|
||||
if (rwTxn != null) {
|
||||
rwTxn.commit();
|
||||
rwTxn.close();
|
||||
rwTxn = null;
|
||||
}
|
||||
assert rwTxn == null;
|
||||
assert readTxn == null;
|
||||
}
|
||||
|
||||
|
@ -27,9 +27,6 @@ import reactor.util.function.Tuples;
|
||||
|
||||
public class LMDBPriorityQueue<T> implements PriorityQueue<T>, Reversable<ReversableResourceIterable<T>>, ReversableResourceIterable<T> {
|
||||
|
||||
private static final boolean FORCE_SYNC = false;
|
||||
private static final boolean DONT_MERGE_TXNS = true;
|
||||
|
||||
private static final AtomicLong NEXT_LMDB_QUEUE_ID = new AtomicLong(0);
|
||||
private static final AtomicLong NEXT_ITEM_UID = new AtomicLong(0);
|
||||
|
||||
@ -56,11 +53,7 @@ public class LMDBPriorityQueue<T> implements PriorityQueue<T>, Reversable<Revers
|
||||
|
||||
this.writing = true;
|
||||
this.iterating = false;
|
||||
if (DONT_MERGE_TXNS) {
|
||||
this.rwTxn = null;
|
||||
} else {
|
||||
this.rwTxn = this.env.txnWrite();
|
||||
}
|
||||
this.rwTxn = null;
|
||||
this.readTxn = null;
|
||||
this.cur = null;
|
||||
}
|
||||
@ -107,10 +100,6 @@ public class LMDBPriorityQueue<T> implements PriorityQueue<T>, Reversable<Revers
|
||||
rwTxn.close();
|
||||
rwTxn = null;
|
||||
}
|
||||
if (FORCE_SYNC) {
|
||||
env.sync(true);
|
||||
}
|
||||
assert rwTxn == null;
|
||||
assert readTxn == null;
|
||||
readTxn = env.txnRead();
|
||||
}
|
||||
@ -129,25 +118,22 @@ public class LMDBPriorityQueue<T> implements PriorityQueue<T>, Reversable<Revers
|
||||
}
|
||||
|
||||
private void endMode() {
|
||||
if (DONT_MERGE_TXNS) {
|
||||
if (cur != null) {
|
||||
cur.close();
|
||||
cur = null;
|
||||
}
|
||||
writing = true;
|
||||
if (readTxn != null) {
|
||||
readTxn.commit();
|
||||
readTxn.close();
|
||||
readTxn = null;
|
||||
}
|
||||
if (rwTxn != null) {
|
||||
rwTxn.commit();
|
||||
rwTxn.close();
|
||||
rwTxn = null;
|
||||
}
|
||||
if (cur != null) {
|
||||
cur.close();
|
||||
cur = null;
|
||||
}
|
||||
writing = true;
|
||||
if (readTxn != null) {
|
||||
readTxn.commit();
|
||||
readTxn.close();
|
||||
readTxn = null;
|
||||
}
|
||||
if (rwTxn != null) {
|
||||
rwTxn.commit();
|
||||
rwTxn.close();
|
||||
rwTxn = null;
|
||||
}
|
||||
assert cur == null;
|
||||
assert rwTxn == null;
|
||||
assert readTxn == null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user