Move prepareForBulkLoad() call after customized RocksDBConfigSetter
*Summary
options.prepareForBulkLoad() and then use the configs from the customized customized RocksDBConfigSetter. This may overwrite the configs set in prepareBulkLoad call. The fix is to move prepareBulkLoad call after applying configs customized RocksDBConfigSetter.
Reviewers: Matthias J. Sax Guozhang Wang Bill Bejeck
@@ -130,10 +130,6 @@ public class RocksDBStore implements KeyValueStore<Bytes, byte[]> {
// (this could be a bug in the RocksDB code and their devs have been contacted).
options.setIncreaseParallelism(Math.max(Runtime.getRuntime().availableProcessors(), 2));
- if (prepareForBulkload) {
- options.prepareForBulkLoad();
- }
-
wOptions = new WriteOptions();
wOptions.setDisableWAL(true);
@@ -148,6 +144,11 @@ public class RocksDBStore implements KeyValueStore<Bytes, byte[]> {
final RocksDBConfigSetter configSetter = Utils.newInstance(configSetterClass);
configSetter.setConfig(name, options, configs);
}
+
+ if (prepareForBulkload) {
+ options.prepareForBulkLoad();
+ }
+
this.dbDir = new File(new File(context.stateDir(), parentDir), this.name);
try {
