Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,16 @@ protected void log(InfoLogLevel infoLogLevel, String logMsg) {
options.setTargetFileSizeBase(settings.getTargetFileSizeBase());

// table options
final BlockBasedTableConfig tableCfg;
options.setTableFormatConfig(tableCfg = new BlockBasedTableConfig());
// NOTE: setTableFormatConfig() materializes the native table factory at call
// time, so it MUST be the last call after all tableCfg setters; otherwise the
// setters mutate only the Java object and never reach the native layer.
BlockBasedTableConfig tableCfg = new BlockBasedTableConfig();
tableCfg.setBlockSize(settings.getBlockSize());
tableCfg.setBlockCache(RocksDbSettings.getCache());
tableCfg.setCacheIndexAndFilterBlocks(true);
tableCfg.setPinL0FilterAndIndexBlocksInCache(true);
tableCfg.setFilter(new BloomFilter(10, false));
options.setTableFormatConfig(tableCfg);
if (Constant.MARKET_PAIR_PRICE_TO_ORDER.equals(dbName)) {
ComparatorOptions comparatorOptions = new ComparatorOptions();
options.setComparator(new MarketOrderPriceComparatorForRocksDB(comparatorOptions));
Expand Down
Loading