public static DBOptions buildDbOptions(int maxBackgroundFlushes, int maxBackgroundCompactions,
int maxBackgroundThreads, long maxLogFileSize) {
DBOptions dbOptions = new DBOptions();
dbOptions.setCreateIfMissing(true).setCreateMissingColumnFamilies(true)
.setErrorIfExists(false);
dbOptions.setMaxBackgroundFlushes(maxBackgroundFlushes)
.setMaxBackgroundCompactions(maxBackgroundCompactions)
.setIncreaseParallelism(maxBackgroundThreads);
dbOptions.setAllowMmapReads(true).setAllowMmapWrites(true);
dbOptions.setMaxOpenFiles(-1);
dbOptions.setKeepLogFileNum(100).setLogFileTimeToRoll(3600)
.setMaxLogFileSize(maxLogFileSize);
return dbOptions;
}