Skip to content

Commit 4574647

Browse files
jjastanjiaoja
and
jiaoja
authored
[ISSUE #8909] Move nullcheck ahead (#8910)
Co-authored-by: jiaoja <[email protected]>
1 parent 797024f commit 4574647

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

common/src/main/java/org/apache/rocketmq/common/config/AbstractRocksDBStorage.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,13 @@ protected void open(final List<ColumnFamilyDescriptor> cfDescriptors) throws Roc
346346
this.db = RocksDB.open(this.options, this.dbPath, cfDescriptors, cfHandles);
347347
}
348348
assert cfDescriptors.size() == cfHandles.size();
349-
try (Env env = this.db.getEnv()) {
350-
env.setBackgroundThreads(8, Priority.LOW);
351-
}
349+
352350
if (this.db == null) {
353351
throw new RocksDBException("open rocksdb null");
354352
}
353+
try (Env env = this.db.getEnv()) {
354+
env.setBackgroundThreads(8, Priority.LOW);
355+
}
355356
}
356357

357358
protected abstract boolean postLoad();

0 commit comments

Comments
 (0)