Skip to content

Commit

Permalink
Fix rocksdb warning after upgrading to version 5.17.2
Browse files Browse the repository at this point in the history
There are warning cause by using some deprecated methods.

fix #323

Change-Id: I63777d5cc38e05e39c9475e31a33bb987f8243e6
  • Loading branch information
javeme authored and zhoney committed Feb 26, 2019
1 parent 234926f commit 7e28d63
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public RocksDBStdSessions(HugeConfig config, String dataPath,
List<ColumnFamilyDescriptor> cfds = new ArrayList<>(cfs.size());
for (String cf : cfs) {
ColumnFamilyDescriptor cfd = new ColumnFamilyDescriptor(encode(cf));
ColumnFamilyOptions options = cfd.columnFamilyOptions();
ColumnFamilyOptions options = cfd.getOptions();
RocksDBStdSessions.initOptions(this.conf, null, options, options);
cfds.add(cfd);
}
Expand Down Expand Up @@ -156,7 +156,7 @@ public void createTable(String table) throws RocksDBException {

// Should we use options.setCreateMissingColumnFamilies() to create CF
ColumnFamilyDescriptor cfd = new ColumnFamilyDescriptor(encode(table));
ColumnFamilyOptions options = cfd.columnFamilyOptions();
ColumnFamilyOptions options = cfd.getOptions();
initOptions(this.conf, null, options, options);
this.cfs.put(table, this.rocksdb.createColumnFamily(cfd));

Expand Down Expand Up @@ -263,6 +263,7 @@ public static Set<String> listCFs(String path) throws RocksDBException {
return cfs;
}

@SuppressWarnings("deprecation") // setMaxBackgroundFlushes
public static void initOptions(HugeConfig conf,
DBOptionsInterface<?> db,
ColumnFamilyOptionsInterface<?> cf,
Expand All @@ -284,6 +285,10 @@ public static void initOptions(HugeConfig conf,
db.setInfoLogLevel(InfoLogLevel.valueOf(
conf.get(RocksDBOptions.LOG_LEVEL) + "_LEVEL"));

/*
* TODO: migrate to max_background_jobs option
* https://github.com/facebook/rocksdb/pull/2205/files
*/
db.setMaxBackgroundCompactions(
conf.get(RocksDBOptions.MAX_BG_COMPACTIONS));
db.setMaxSubcompactions(
Expand Down

0 comments on commit 7e28d63

Please sign in to comment.