in core/src/main/java/org/apache/rocketmq/streams/core/state/RocksDBStore.java [56:83]
private void createRocksDB(String path) {
try (final Options options = new Options().setCreateIfMissing(true)) {
try {
String rocksdbFilePath = String.format("%s/%s", ROCKSDB_PATH, path);
storeFile = new File(rocksdbFilePath);
if (storeFile.exists()) {
FileUtils.forceDelete(storeFile);
}
if (!storeFile.mkdirs()) {
throw new RuntimeException("before create rocksdb,mkdir path " + rocksdbFilePath + " error");
}
this.rocksDB = TtlDB.open(options, rocksdbFilePath, 10800, false);
writeOptions = new WriteOptions();
writeOptions.setSync(false);
writeOptions.setDisableWAL(true);
} catch (RocksDBException e) {
throw new RuntimeException("create rocksdb error " + e.getMessage());
} catch (IOException e) {
throw new RuntimeException("delete rocksdb directory:" + ROCKSDB_PATH + "field.");
}
}
}