Skip to content
Merged
Show file tree
Hide file tree
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 @@ -24,6 +24,7 @@
import org.apache.hadoop.hdds.utils.db.managed.ManagedColumnFamilyOptions;
import org.apache.hadoop.hdds.utils.db.managed.ManagedDBOptions;
import org.apache.hadoop.hdds.utils.db.managed.ManagedLRUCache;
import org.rocksdb.CompactionPriority;
import org.rocksdb.CompactionStyle;

/**
Expand Down Expand Up @@ -65,10 +66,12 @@ public ManagedDBOptions getDBOptions() {
final long bytesPerSync = toLong(StorageUnit.MB.toBytes(1.00));
final boolean createIfMissing = true;
final boolean createMissingColumnFamilies = true;
final int maxBackgroundJobs = 6;
ManagedDBOptions dbOptions = new ManagedDBOptions();
dbOptions
.setIncreaseParallelism(Runtime.getRuntime().availableProcessors())
.setMaxBackgroundCompactions(maxBackgroundCompactions)
.setMaxBackgroundJobs(maxBackgroundJobs)
.setMaxBackgroundFlushes(maxBackgroundFlushes)
.setBytesPerSync(bytesPerSync)
.setCreateIfMissing(createIfMissing)
Expand All @@ -88,6 +91,7 @@ public ManagedBlockBasedTableConfig getBlockBasedTableConfig() {
config.setBlockCache(new ManagedLRUCache(blockCacheSize))
.setBlockSize(blockSize)
.setPinL0FilterAndIndexBlocksInCache(true)
.setCacheIndexAndFilterBlocks(true)
.setFilterPolicy(new ManagedBloomFilter());
return config;
}
Expand All @@ -111,6 +115,7 @@ public ManagedDBOptions getDBOptions() {
public ManagedColumnFamilyOptions getColumnFamilyOptions() {
ManagedColumnFamilyOptions cfOptions = SSD.getColumnFamilyOptions();
cfOptions.setCompactionStyle(CompactionStyle.LEVEL);
cfOptions.setCompactionPriority(CompactionPriority.MinOverlappingRatio);
return cfOptions;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public synchronized ManagedBlockBasedTableConfig setBlockCache(

blockCacheHolder = blockCache;
super.setBlockCache(blockCache);
super.setCacheIndexAndFilterBlocks(true);
return this;
}

Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,7 @@
<!-- Allow non-RocksObject classes. -->
<allowedImport>org.rocksdb.ColumnFamilyDescriptor</allowedImport>
<allowedImport>org.rocksdb.CompactionStyle</allowedImport>
<allowedImport>org.rocksdb.CompactionPriority</allowedImport>
<allowedImport>org.rocksdb.KeyMayExist</allowedImport>
<allowedImport>org.rocksdb.HistogramData</allowedImport>
<allowedImport>org.rocksdb.HistogramType</allowedImport>
Expand Down
Loading