|
|
@ -57,38 +57,35 @@ public class RocksDBSample { |
|
|
|
assert(options.compressionType() == CompressionType.SNAPPY_COMPRESSION); |
|
|
|
assert(options.compressionType() == CompressionType.SNAPPY_COMPRESSION); |
|
|
|
assert(options.compactionStyle() == CompactionStyle.UNIVERSAL); |
|
|
|
assert(options.compactionStyle() == CompactionStyle.UNIVERSAL); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
assert(options.memTableFactoryName().equals("SkipListFactory")); |
|
|
|
assert(options.memTableFactoryName().equals("SkipListFactory")); |
|
|
|
options.setMemTableConfig( |
|
|
|
options.setMemTableConfig( |
|
|
|
new HashSkipListMemTableConfig() |
|
|
|
new HashSkipListMemTableConfig() |
|
|
|
.setHeight(4) |
|
|
|
.setHeight(4) |
|
|
|
.setBranchingFactor(4) |
|
|
|
.setBranchingFactor(4) |
|
|
|
.setBucketCount(2000000)); |
|
|
|
.setBucketCount(2000000)); |
|
|
|
assert(options.memTableFactoryName().equals("HashSkipListRepFactory")); |
|
|
|
assert(options.memTableFactoryName().equals("HashSkipListRepFactory")); |
|
|
|
|
|
|
|
|
|
|
|
options.setMemTableConfig( |
|
|
|
options.setMemTableConfig( |
|
|
|
new HashLinkedListMemTableConfig() |
|
|
|
new HashLinkedListMemTableConfig() |
|
|
|
.setBucketCount(100000)); |
|
|
|
.setBucketCount(100000)); |
|
|
|
assert(options.memTableFactoryName().equals("HashLinkedListRepFactory")); |
|
|
|
assert(options.memTableFactoryName().equals("HashLinkedListRepFactory")); |
|
|
|
|
|
|
|
|
|
|
|
options.setMemTableConfig( |
|
|
|
options.setMemTableConfig( |
|
|
|
new VectorMemTableConfig().setReservedSize(10000)); |
|
|
|
new VectorMemTableConfig().setReservedSize(10000)); |
|
|
|
assert(options.memTableFactoryName().equals("VectorRepFactory")); |
|
|
|
assert(options.memTableFactoryName().equals("VectorRepFactory")); |
|
|
|
|
|
|
|
|
|
|
|
options.setMemTableConfig(new SkipListMemTableConfig()); |
|
|
|
options.setMemTableConfig(new SkipListMemTableConfig()); |
|
|
|
assert(options.memTableFactoryName().equals("SkipListFactory")); |
|
|
|
assert(options.memTableFactoryName().equals("SkipListFactory")); |
|
|
|
|
|
|
|
|
|
|
|
options.setTableFormatConfig(new PlainTableConfig()); |
|
|
|
options.setTableFormatConfig(new PlainTableConfig()); |
|
|
|
// Plain-Table requires mmap read
|
|
|
|
// Plain-Table requires mmap read
|
|
|
|
options.setAllowMmapReads(true); |
|
|
|
options.setAllowMmapReads(true); |
|
|
|
assert(options.tableFactoryName().equals("PlainTable")); |
|
|
|
assert(options.tableFactoryName().equals("PlainTable")); |
|
|
|
|
|
|
|
|
|
|
|
options.setRateLimiterConfig(new GenericRateLimiterConfig(10000000, |
|
|
|
options.setRateLimiterConfig(new GenericRateLimiterConfig(10000000, |
|
|
|
10000, 10)); |
|
|
|
10000, 10)); |
|
|
|
options.setRateLimiterConfig(new GenericRateLimiterConfig(10000000)); |
|
|
|
options.setRateLimiterConfig(new GenericRateLimiterConfig(10000000)); |
|
|
|
|
|
|
|
} catch (RocksDBException e) { |
|
|
|
|
|
|
|
assert(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Filter bloomFilter = new BloomFilter(10); |
|
|
|
Filter bloomFilter = new BloomFilter(10); |
|
|
|
BlockBasedTableConfig table_options = new BlockBasedTableConfig(); |
|
|
|
BlockBasedTableConfig table_options = new BlockBasedTableConfig(); |
|
|
|