Bugfix
This commit is contained in:
parent
dfe8361e19
commit
7b66259da6
@ -287,7 +287,7 @@ public class LLLocalDictionary implements LLDictionary {
|
||||
assert !Schedulers.isInNonBlockingThread() : "Called isRangeEmpty in a nonblocking thread";
|
||||
startedContains.increment();
|
||||
try {
|
||||
var result = containsTime.recordCallable(() -> {
|
||||
Boolean isRangeEmpty = containsTime.recordCallable(() -> {
|
||||
if (range.isSingle()) {
|
||||
return !containsKey(snapshot, range.getSingleUnsafe());
|
||||
} else {
|
||||
@ -330,7 +330,7 @@ public class LLLocalDictionary implements LLDictionary {
|
||||
rocksIterator.seekToFirst();
|
||||
}
|
||||
rocksIterator.status();
|
||||
return rocksIterator.isValid();
|
||||
return !rocksIterator.isValid();
|
||||
}
|
||||
} finally {
|
||||
if (slice1 != null) {
|
||||
@ -342,8 +342,8 @@ public class LLLocalDictionary implements LLDictionary {
|
||||
}
|
||||
}
|
||||
});
|
||||
assert result != null;
|
||||
sink.next(!result);
|
||||
assert isRangeEmpty != null;
|
||||
sink.next(isRangeEmpty);
|
||||
} catch (RocksDBException ex) {
|
||||
sink.error(new RocksDBException("Failed to read range " + LLUtils.toStringSafe(range)
|
||||
+ ": " + ex.getMessage()));
|
||||
|
@ -515,10 +515,7 @@ public class LLMemoryDictionary implements LLDictionary {
|
||||
@Override
|
||||
public Mono<Boolean> isRangeEmpty(@Nullable LLSnapshot snapshot, Mono<Send<LLRange>> rangeMono, boolean fillCache) {
|
||||
return getRangeKeys(snapshot, rangeMono)
|
||||
.map(buf -> {
|
||||
buf.receive().close();
|
||||
return true;
|
||||
})
|
||||
.doOnNext(buf -> buf.receive().close())
|
||||
.count()
|
||||
.map(count -> count == 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user