|
|
|
@ -18,7 +18,7 @@ public class BlockBasedTableConfig extends TableFormatConfig { |
|
|
|
|
blockSizeDeviation_ = 10; |
|
|
|
|
blockRestartInterval_ = 16; |
|
|
|
|
wholeKeyFiltering_ = true; |
|
|
|
|
bitsPerKey_ = 10; |
|
|
|
|
filter_ = null; |
|
|
|
|
cacheIndexAndFilterBlocks_ = false; |
|
|
|
|
hashIndexAllowCollision_ = true; |
|
|
|
|
blockCacheCompressedSize_ = 0; |
|
|
|
@ -182,11 +182,11 @@ public class BlockBasedTableConfig extends TableFormatConfig { |
|
|
|
|
* |
|
|
|
|
* Filter instance can be re-used in multiple options instances. |
|
|
|
|
* |
|
|
|
|
* @param Filter policy java instance. |
|
|
|
|
* @param Filter Filter Policy java instance. |
|
|
|
|
* @return the reference to the current config. |
|
|
|
|
*/ |
|
|
|
|
public BlockBasedTableConfig setFilterBitsPerKey(int bitsPerKey) { |
|
|
|
|
bitsPerKey_ = bitsPerKey; |
|
|
|
|
public BlockBasedTableConfig setFilter(Filter filter) { |
|
|
|
|
filter_ = filter; |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -293,17 +293,23 @@ public class BlockBasedTableConfig extends TableFormatConfig { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override protected long newTableFactoryHandle() { |
|
|
|
|
long filterHandle = 0; |
|
|
|
|
if (filter_ != null) { |
|
|
|
|
filterHandle = filter_.nativeHandle_; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return newTableFactoryHandle(noBlockCache_, blockCacheSize_, |
|
|
|
|
blockCacheNumShardBits_, blockSize_, blockSizeDeviation_, |
|
|
|
|
blockRestartInterval_, wholeKeyFiltering_, bitsPerKey_, |
|
|
|
|
cacheIndexAndFilterBlocks_, hashIndexAllowCollision_, |
|
|
|
|
blockCacheCompressedSize_, blockCacheCompressedNumShardBits_); |
|
|
|
|
blockRestartInterval_, wholeKeyFiltering_, |
|
|
|
|
filterHandle, cacheIndexAndFilterBlocks_, |
|
|
|
|
hashIndexAllowCollision_, blockCacheCompressedSize_, |
|
|
|
|
blockCacheCompressedNumShardBits_); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private native long newTableFactoryHandle( |
|
|
|
|
boolean noBlockCache, long blockCacheSize, int blockCacheNumShardBits, |
|
|
|
|
long blockSize, int blockSizeDeviation, int blockRestartInterval, |
|
|
|
|
boolean wholeKeyFiltering, int bitsPerKey, |
|
|
|
|
boolean wholeKeyFiltering, long filterPolicyHandle, |
|
|
|
|
boolean cacheIndexAndFilterBlocks, boolean hashIndexAllowCollision, |
|
|
|
|
long blockCacheCompressedSize, int blockCacheCompressedNumShardBits); |
|
|
|
|
|
|
|
|
@ -315,7 +321,7 @@ public class BlockBasedTableConfig extends TableFormatConfig { |
|
|
|
|
private int blockSizeDeviation_; |
|
|
|
|
private int blockRestartInterval_; |
|
|
|
|
private boolean wholeKeyFiltering_; |
|
|
|
|
private int bitsPerKey_; |
|
|
|
|
private Filter filter_; |
|
|
|
|
private boolean cacheIndexAndFilterBlocks_; |
|
|
|
|
private boolean hashIndexAllowCollision_; |
|
|
|
|
private long blockCacheCompressedSize_; |
|
|
|
|