Browse Source

modify exception handle of rocksdb's config

tags/1.1.10
shaozhuguang 5 years ago
parent
commit
5939ba2fc0
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      source/storage/storage-rocksdb/src/main/java/com/jd/blockchain/storage/service/impl/rocksdb/RocksDBConnectionFactory.java

+ 4
- 2
source/storage/storage-rocksdb/src/main/java/com/jd/blockchain/storage/service/impl/rocksdb/RocksDBConnectionFactory.java View File

@@ -23,7 +23,8 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;

public class RocksDBConnectionFactory implements DbConnectionFactory {
private Logger logger = LoggerFactory.getLogger(RocksDBConnectionFactory.class);

private static Logger logger = LoggerFactory.getLogger(RocksDBConnectionFactory.class);

private static final String DB_CONFIG_ARG = "rb";

@@ -158,12 +159,13 @@ public class RocksDBConnectionFactory implements DbConnectionFactory {
private static void init() {
String dbConfigPath = System.getProperty(DB_CONFIG_ARG);
if (dbConfigPath != null && dbConfigPath.length() > 0) {
logger.debug("rocksdb.config -> {}", dbConfigPath);
File dbConfigFile = new File(dbConfigPath);
try {
dbConfigProperties = new Properties();
dbConfigProperties.load(new FileInputStream(dbConfigFile));
} catch (Exception e) {
throw new IllegalStateException(String.format("Load rocksdb.config %s error !!!", dbConfigPath), e);
logger.warn(String.format("Load rocksdb.config[%s] error !!!", dbConfigPath), e);
}
}
}


Loading…
Cancel
Save