merlimat closed pull request #840: Fixed RocksDb storage options instantiation
after library is loaded
URL: https://github.com/apache/bookkeeper/pull/840
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
index 0978fc0b2..ed4053114 100644
---
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
+++
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
@@ -56,13 +56,13 @@
private final RocksDB db;
- private final WriteOptions optionSync = new WriteOptions();
- private final WriteOptions optionDontSync = new WriteOptions();
+ private final WriteOptions optionSync;
+ private final WriteOptions optionDontSync;
- private final ReadOptions optionCache = new ReadOptions();
- private final ReadOptions optionDontCache = new ReadOptions();
+ private final ReadOptions optionCache;
+ private final ReadOptions optionDontCache;
- private final WriteBatch emptyBatch = new WriteBatch();
+ private final WriteBatch emptyBatch;
private static final String ROCKSDB_LOG_LEVEL =
"dbStorage_rocksDB_logLevel";
private static final String ROCKSDB_WRITE_BUFFER_SIZE_MB =
"dbStorage_rocksDB_writeBufferSizeMB";
@@ -86,6 +86,12 @@ public KeyValueStorageRocksDB(String path, DbConfigType
dbConfigType, ServerConf
throw new IOException("Failed to load RocksDB JNI library", t);
}
+ this.optionSync = new WriteOptions();
+ this.optionDontSync = new WriteOptions();
+ this.optionCache = new ReadOptions();
+ this.optionDontCache = new ReadOptions();
+ this.emptyBatch = new WriteBatch();
+
try (Options options = new Options()) {
options.setCreateIfMissing(true);
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services