Browse Source

modify config of rocksdb

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

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

@@ -108,6 +108,7 @@ public class RocksDBConnectionFactory implements DbConnectionFactory {
int optionMaxBackgroundFlushes = getInt(dbProperties, "option.maxBackgroundFlushes", 4);

Cache cache = new LRUCache(cacheCapacity, cacheNumShardBits, false);
BloomFilter bloomFilter = tableBloomBitsPerKey <= 0 ? null : new BloomFilter(tableBloomBitsPerKey);

final BlockBasedTableConfig tableOptions = new BlockBasedTableConfig()
.setBlockCache(cache)
@@ -117,7 +118,7 @@ public class RocksDBConnectionFactory implements DbConnectionFactory {
.setIndexType(IndexType.kTwoLevelIndexSearch) // 设置两级索引,控制索引占用内存
.setPinTopLevelIndexAndFilter(false)
.setBlockSize(tableBlockSize)
.setFilterPolicy(null) // 不设置布隆过滤器
.setFilterPolicy(bloomFilter) // 设置布隆过滤器
;

Options options = new Options()


Loading…
Cancel
Save