Rename constants
This commit is contained in:
parent
90aa7a2522
commit
db9b1bb7fb
@ -30,7 +30,7 @@ public class LLTempLMDBEnv implements Closeable {
|
||||
.setMapSize(TWENTY_GIBIBYTES)
|
||||
.setMaxDbs(MAX_DATABASES);
|
||||
//env = envBuilder.open(tempDirectory.toFile(), MDB_NOLOCK, MDB_NOSYNC, MDB_NOTLS, MDB_NORDAHEAD, MDB_WRITEMAP);
|
||||
env = envBuilder.open(tempDirectory.toFile(), MDB_NOTLS, MDB_WRITEMAP, MDB_NORDAHEAD);
|
||||
env = envBuilder.open(tempDirectory.toFile(), MDB_NOTLS, MDB_NOSYNC, MDB_NORDAHEAD, MDB_NOMETASYNC);
|
||||
}
|
||||
|
||||
public Env<ByteBuf> getEnv() {
|
||||
|
@ -18,7 +18,7 @@ import org.lmdbjava.Txn;
|
||||
public class LMDBArray<V> implements IArray<V>, Closeable {
|
||||
|
||||
private static final boolean FORCE_SYNC = false;
|
||||
private static final boolean FORCE_THREAD_LOCAL = true;
|
||||
private static final boolean DONT_MERGE_TXNS = true;
|
||||
|
||||
private static final AtomicLong NEXT_LMDB_ARRAY_ID = new AtomicLong(0);
|
||||
|
||||
@ -43,7 +43,7 @@ public class LMDBArray<V> implements IArray<V>, Closeable {
|
||||
this.defaultValue = defaultValue;
|
||||
|
||||
this.writing = true;
|
||||
if (FORCE_THREAD_LOCAL) {
|
||||
if (DONT_MERGE_TXNS) {
|
||||
this.rwTxn = null;
|
||||
} else {
|
||||
this.rwTxn = this.env.txnWrite();
|
||||
@ -91,7 +91,7 @@ public class LMDBArray<V> implements IArray<V>, Closeable {
|
||||
}
|
||||
|
||||
private void endMode() {
|
||||
if (FORCE_THREAD_LOCAL) {
|
||||
if (DONT_MERGE_TXNS) {
|
||||
writing = true;
|
||||
if (readTxn != null) {
|
||||
readTxn.commit();
|
||||
|
@ -28,7 +28,7 @@ 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 FORCE_THREAD_LOCAL = true;
|
||||
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,7 +56,7 @@ public class LMDBPriorityQueue<T> implements PriorityQueue<T>, Reversable<Revers
|
||||
|
||||
this.writing = true;
|
||||
this.iterating = false;
|
||||
if (FORCE_THREAD_LOCAL) {
|
||||
if (DONT_MERGE_TXNS) {
|
||||
this.rwTxn = null;
|
||||
} else {
|
||||
this.rwTxn = this.env.txnWrite();
|
||||
@ -129,7 +129,7 @@ public class LMDBPriorityQueue<T> implements PriorityQueue<T>, Reversable<Revers
|
||||
}
|
||||
|
||||
private void endMode() {
|
||||
if (FORCE_THREAD_LOCAL) {
|
||||
if (DONT_MERGE_TXNS) {
|
||||
if (cur != null) {
|
||||
cur.close();
|
||||
cur = null;
|
||||
|
@ -64,8 +64,14 @@ public class AdaptiveMultiSearcher implements MultiSearcher {
|
||||
return scoredPaged.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
||||
} else {
|
||||
if ((queryParams.isSorted() && !queryParams.isSortedByScore())) {
|
||||
if (queryParams.limitLong() < MAX_IN_MEMORY_SIZE) {
|
||||
throw new UnsupportedOperationException("Allowed limit is " + MAX_IN_MEMORY_SIZE + " or greater");
|
||||
}
|
||||
return sortedScoredFull.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
||||
} else {
|
||||
if (queryParams.limitLong() < MAX_IN_MEMORY_SIZE) {
|
||||
throw new UnsupportedOperationException("Allowed limit is " + MAX_IN_MEMORY_SIZE + " or greater");
|
||||
}
|
||||
return unsortedScoredFull.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
||||
}
|
||||
}
|
||||
|
@ -65,9 +65,6 @@ public class SortedScoredFullMultiSearcher implements MultiSearcher {
|
||||
.fromCallable(() -> {
|
||||
LLUtils.ensureBlocking();
|
||||
var totalHitsThreshold = queryParams.getTotalHitsThresholdLong();
|
||||
if (queryParams.limitLong() < MAX_IN_MEMORY_SIZE) {
|
||||
throw new UnsupportedOperationException("Allowed limit is " + MAX_IN_MEMORY_SIZE + " or greater");
|
||||
}
|
||||
return LMDBFullFieldDocCollector.createSharedManager(env, queryParams.sort(), queryParams.limitInt(),
|
||||
totalHitsThreshold);
|
||||
})
|
||||
|
@ -69,9 +69,6 @@ public class UnsortedScoredFullMultiSearcher implements MultiSearcher {
|
||||
return Mono
|
||||
.fromCallable(() -> {
|
||||
LLUtils.ensureBlocking();
|
||||
if (queryParams.limitLong() < MAX_IN_MEMORY_SIZE) {
|
||||
throw new UnsupportedOperationException("Allowed limit is " + MAX_IN_MEMORY_SIZE + " or greater");
|
||||
}
|
||||
var totalHitsThreshold = queryParams.getTotalHitsThresholdLong();
|
||||
return LMDBFullScoreDocCollector.createSharedManager(env, queryParams.limitLong(), totalHitsThreshold);
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user