Code cleanup

This commit is contained in:
Andrea Cavalli 2022-05-02 19:05:40 +02:00
parent 19bb638f20
commit 614d24ac8d

View File

@ -1003,29 +1003,26 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase {
@Override
public Mono<LLLocalDictionary> getDictionary(byte[] columnName, UpdateMode updateMode) {
return Mono
.fromCallable(() -> {
var closeReadLock = closeLock.readLock();
try {
ensureOpen();
var cfh = getCfh(columnName);
ensureOwned(cfh);
return new LLLocalDictionary(
allocator,
getRocksDBColumn(db, cfh),
name,
ColumnUtils.toString(columnName),
dbWScheduler,
dbRScheduler,
this::getSnapshotLambda,
updateMode,
databaseOptions
);
} finally {
closeLock.unlockRead(closeReadLock);
}
})
.subscribeOn(dbRScheduler);
return Mono.fromCallable(() -> {
var closeReadLock = closeLock.readLock();
try {
ensureOpen();
var cfh = getCfh(columnName);
ensureOwned(cfh);
return new LLLocalDictionary(allocator,
getRocksDBColumn(db, cfh),
name,
ColumnUtils.toString(columnName),
dbWScheduler,
dbRScheduler,
this::getSnapshotLambda,
updateMode,
databaseOptions
);
} finally {
closeLock.unlockRead(closeReadLock);
}
}).subscribeOn(dbRScheduler);
}
public RocksDBColumn getRocksDBColumn(byte[] columnName) {