Bugfix in sizeRange
This commit is contained in:
parent
fd565c80b2
commit
6f8f70c23b
@ -2085,16 +2085,14 @@ public class LLLocalDictionary implements LLDictionary {
|
|||||||
public Mono<Long> sizeRange(@Nullable LLSnapshot snapshot, Mono<Send<LLRange>> rangeMono, boolean fast) {
|
public Mono<Long> sizeRange(@Nullable LLSnapshot snapshot, Mono<Send<LLRange>> rangeMono, boolean fast) {
|
||||||
return Mono.usingWhen(rangeMono,
|
return Mono.usingWhen(rangeMono,
|
||||||
rangeSend -> {
|
rangeSend -> {
|
||||||
try (var range = rangeSend.receive()) {
|
return runOnDb(() -> {
|
||||||
if (Schedulers.isInNonBlockingThread()) {
|
try (var range = rangeSend.receive()) {
|
||||||
throw new UnsupportedOperationException("Called sizeRange in a nonblocking thread");
|
if (Schedulers.isInNonBlockingThread()) {
|
||||||
}
|
throw new UnsupportedOperationException("Called sizeRange in a nonblocking thread");
|
||||||
if (range.isAll()) {
|
}
|
||||||
return this
|
if (range.isAll()) {
|
||||||
.runOnDb(() -> fast ? fastSizeAll(snapshot) : exactSizeAll(snapshot))
|
return fast ? fastSizeAll(snapshot) : exactSizeAll(snapshot);
|
||||||
.onErrorMap(IOException::new);
|
} else {
|
||||||
} else {
|
|
||||||
return runOnDb(() -> {
|
|
||||||
try (var readOpts = new ReadOptions(resolveSnapshot(snapshot))) {
|
try (var readOpts = new ReadOptions(resolveSnapshot(snapshot))) {
|
||||||
readOpts.setFillCache(false);
|
readOpts.setFillCache(false);
|
||||||
readOpts.setVerifyChecksums(VERIFY_CHECKSUMS_WHEN_NOT_NEEDED);
|
readOpts.setVerifyChecksums(VERIFY_CHECKSUMS_WHEN_NOT_NEEDED);
|
||||||
@ -2149,9 +2147,9 @@ public class LLLocalDictionary implements LLDictionary {
|
|||||||
minBound.close();
|
minBound.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).onErrorMap(cause -> new IOException("Failed to get size of range " + range, cause));
|
}
|
||||||
}
|
}
|
||||||
}
|
}).onErrorMap(cause -> new IOException("Failed to get size of range", cause));
|
||||||
},
|
},
|
||||||
rangeSend -> Mono.fromRunnable(rangeSend::close)
|
rangeSend -> Mono.fromRunnable(rangeSend::close)
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user