Fix unmodifiable read options
This commit is contained in:
parent
cb8dbf2fa2
commit
2df2c00e36
|
@ -1251,8 +1251,7 @@ public class LLLocalDictionary implements LLDictionary {
|
||||||
public Flux<BadBlock> badBlocks(LLRange range) {
|
public Flux<BadBlock> badBlocks(LLRange range) {
|
||||||
return Flux
|
return Flux
|
||||||
.<BadBlock>create(sink -> {
|
.<BadBlock>create(sink -> {
|
||||||
try {
|
try (var ro = new ReadOptions(getReadOptions(null))) {
|
||||||
var ro = new ReadOptions(getReadOptions(null));
|
|
||||||
ro.setFillCache(false);
|
ro.setFillCache(false);
|
||||||
if (!range.isSingle()) {
|
if (!range.isSingle()) {
|
||||||
ro.setReadaheadSize(32 * 1024);
|
ro.setReadaheadSize(32 * 1024);
|
||||||
|
@ -1666,7 +1665,7 @@ public class LLLocalDictionary implements LLDictionary {
|
||||||
public Mono<Void> clear() {
|
public Mono<Void> clear() {
|
||||||
return Mono
|
return Mono
|
||||||
.<Void>fromCallable(() -> {
|
.<Void>fromCallable(() -> {
|
||||||
var readOpts = getReadOptions(null);
|
try (var readOpts = new ReadOptions(getReadOptions(null))) {
|
||||||
readOpts.setVerifyChecksums(VERIFY_CHECKSUMS_WHEN_NOT_NEEDED);
|
readOpts.setVerifyChecksums(VERIFY_CHECKSUMS_WHEN_NOT_NEEDED);
|
||||||
|
|
||||||
// readOpts.setIgnoreRangeDeletions(true);
|
// readOpts.setIgnoreRangeDeletions(true);
|
||||||
|
@ -1713,6 +1712,7 @@ public class LLLocalDictionary implements LLDictionary {
|
||||||
db.flushWal(true);
|
db.flushWal(true);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.onErrorMap(cause -> new IOException("Failed to clear", cause))
|
.onErrorMap(cause -> new IOException("Failed to clear", cause))
|
||||||
.subscribeOn(dbScheduler);
|
.subscribeOn(dbScheduler);
|
||||||
|
|
|
@ -481,6 +481,7 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
|
||||||
|
|
||||||
private ColumnFamilyHandle getCfh(byte[] columnName) throws RocksDBException {
|
private ColumnFamilyHandle getCfh(byte[] columnName) throws RocksDBException {
|
||||||
ColumnFamilyHandle cfh = handles.get(Column.special(Column.toString(columnName)));
|
ColumnFamilyHandle cfh = handles.get(Column.special(Column.toString(columnName)));
|
||||||
|
//noinspection RedundantIfStatement
|
||||||
if (!enableColumnsBug) {
|
if (!enableColumnsBug) {
|
||||||
assert Arrays.equals(cfh.getName(), columnName);
|
assert Arrays.equals(cfh.getName(), columnName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user