Merge remote-tracking branch 'origin/sync-grpc' into sync-grpc
This commit is contained in:
commit
1ca62c5813
@ -431,8 +431,8 @@ public class EmbeddedDB implements RocksDBSyncAPI, Closeable {
|
||||
var key = keyIt.next();
|
||||
var value = valusIt.next();
|
||||
put(arena, wb, col, 0, key, value, requestType);
|
||||
wb.write(db.get());
|
||||
}
|
||||
wb.write(db.get());
|
||||
}
|
||||
return List.of();
|
||||
} catch (it.cavallium.rockserver.core.common.RocksDBException ex) {
|
||||
|
@ -7,9 +7,9 @@ import org.rocksdb.WriteBatch;
|
||||
import org.rocksdb.WriteOptions;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
public record WB(@NotNull WriteBatch wb) implements Closeable, TxOrWb {
|
||||
private static final boolean MIGRATE = Boolean.parseBoolean(System.getProperty("rocksdb.migrate", "false"));
|
||||
@Override
|
||||
public void close() {
|
||||
wb.close();
|
||||
@ -17,6 +17,9 @@ public record WB(@NotNull WriteBatch wb) implements Closeable, TxOrWb {
|
||||
|
||||
public void write(RocksDB rocksDB) throws RocksDBException {
|
||||
try (var w = new WriteOptions()) {
|
||||
if (MIGRATE) {
|
||||
w.setDisableWAL(true);
|
||||
}
|
||||
rocksDB.write(w, wb);
|
||||
} catch (org.rocksdb.RocksDBException e) {
|
||||
throw RocksDBException.of(RocksDBException.RocksDBErrorType.WRITE_BATCH_1, e);
|
||||
|
Loading…
Reference in New Issue
Block a user