Source:
private RocksDB initRocksDB() throws IOException, RocksDBException { if(!Files.exists(rocksdbDir)) { Files.createDirectories(rocksdbDir); } final List<String> cfNames = loadColumnFamilyNames(); final List<ColumnFamilyOptions> cfOptionss = new ArrayList<>(); final List<ColumnFamilyDescriptor> cfDescriptors = new ArrayList<>(); for(final String cfName : cfNames) { final ColumnFamilyOptions cfOptions = new ColumnFamilyOptions() .optimizeLevelStyleCompaction(); final ColumnFamilyDescriptor cfDescriptor = new ColumnFamilyDescriptor( cfName.getBytes(UTF_8), cfOptions ); cfOptionss.add(cfOptions); cfDescriptors.add(cfDescriptor); } final int rocksThreads = Runtime.getRuntime().availableProcessors() * 2; if(cfDescriptors.isEmpty()) { final Options options = new Options() .optimizeLevelStyleCompaction() .setCreateIfMissing(true) .setCreateMissingColumnFamilies(true) .setIncreaseParallelism(rocksThreads) .setMaxBackgroundCompactions(rocksThreads) .setInfoLogLevel(InfoLogLevel.INFO_LEVEL); dbOptions = options; return RocksDB.open(options, rocksdbDir.toAbsolutePath().toString()); } else { final DBOptions options = new DBOptions() .setCreateIfMissing(true) .setCreateMissingColumnFamilies(true) .setIncreaseParallelism(rocksThreads) .setMaxBackgroundCompactions(rocksThreads) .setInfoLogLevel(InfoLogLevel.INFO_LEVEL); dbOptions = options; final List<ColumnFamilyHandle> cfHandles = new ArrayList<>(); final RocksDB db = RocksDB.open(options, rocksdbDir.toAbsolutePath().toString(), cfDescriptors, cfHandles); for(int i = 0; i < cfNames.size(); i++) { COLUMN_FAMILIES.put(cfNames.get(i), new ColumnFamily(cfHandles.get(i), cfOptionss.get(i))); } return db; } }

Target:
private RocksDB initRocksDB() throws IOException, RocksDBException { if(!Files.exists(rocksDbDir)) { Files.createDirectories(rocksDbDir); } final List<String> cfNames = loadColumnFamilyNames(); final List<ColumnFamilyOptions> cfOptionss = new ArrayList<>(); final List<ColumnFamilyDescriptor> cfDescriptors = new ArrayList<>(); for(final String cfName : cfNames) { final ColumnFamilyOptions cfOptions = new ColumnFamilyOptions() .optimizeLevelStyleCompaction(); final ColumnFamilyDescriptor cfDescriptor = new ColumnFamilyDescriptor( cfName.getBytes(UTF_8), cfOptions ); cfOptionss.add(cfOptions); cfDescriptors.add(cfDescriptor); } final int rocksThreads = Runtime.getRuntime().availableProcessors() * 2; if(cfDescriptors.isEmpty()) { final Options options = new Options() .optimizeLevelStyleCompaction() .setCreateIfMissing(true) .setCreateMissingColumnFamilies(true) .setIncreaseParallelism(rocksThreads) .setMaxBackgroundCompactions(rocksThreads) .setInfoLogLevel(InfoLogLevel.INFO_LEVEL); dbOptions = options; return RocksDB.open(options, rocksDbDir.toAbsolutePath().toString()); } else { final DBOptions options = new DBOptions() .setCreateIfMissing(true) .setCreateMissingColumnFamilies(true) .setIncreaseParallelism(rocksThreads) .setMaxBackgroundCompactions(rocksThreads) .setInfoLogLevel(InfoLogLevel.INFO_LEVEL); dbOptions = options; final List<ColumnFamilyHandle> cfHandles = new ArrayList<>(); final RocksDB db = RocksDB.open(options, rocksDbDir.toAbsolutePath().toString(), cfDescriptors, cfHandles); for(int i = 0; i < cfNames.size(); i++) { COLUMN_FAMILIES.put(cfNames.get(i), new ColumnFamily(cfHandles.get(i), cfOptionss.get(i))); } return db; } }