public class BlockBasedTableConfig extends TableFormatConfig
Constructor and Description |
---|
BlockBasedTableConfig() |
Modifier and Type | Method and Description |
---|---|
int |
blockCacheCompressedNumShardBits()
Controls the number of shards for the block compressed cache.
|
long |
blockCacheCompressedSize()
Size of compressed block cache.
|
long |
blockCacheSize() |
int |
blockRestartInterval() |
long |
blockSize() |
int |
blockSizeDeviation() |
boolean |
cacheIndexAndFilterBlocks()
Indicating if we'd put index/filter blocks to the block cache.
|
int |
cacheNumShardBits()
Returns the number of shard bits used in the block cache.
|
ChecksumType |
checksumType() |
int |
formatVersion() |
boolean |
hashIndexAllowCollision()
Influence the behavior when kHashSearch is used.
|
IndexType |
indexType() |
protected long |
newTableFactoryHandle()
This function should only be called by Options.setTableFormatConfig(),
which will create a c++ shared-pointer to the c++ TableFactory
that associated with the Java TableFormatConfig.
|
boolean |
noBlockCache() |
boolean |
pinL0FilterAndIndexBlocksInCache()
Indicating if we'd like to pin L0 index/filter blocks to the block cache.
|
BlockBasedTableConfig |
setBlockCacheCompressedNumShardBits(int blockCacheCompressedNumShardBits)
Controls the number of shards for the block compressed cache.
|
BlockBasedTableConfig |
setBlockCacheCompressedSize(long blockCacheCompressedSize)
Size of compressed block cache.
|
BlockBasedTableConfig |
setBlockCacheSize(long blockCacheSize)
Set the amount of cache in bytes that will be used by RocksDB.
|
BlockBasedTableConfig |
setBlockRestartInterval(int restartInterval)
Set block restart interval
|
BlockBasedTableConfig |
setBlockSize(long blockSize)
Approximate size of user data packed per block.
|
BlockBasedTableConfig |
setBlockSizeDeviation(int blockSizeDeviation)
This is used to close a block before it reaches the configured
'block_size'.
|
BlockBasedTableConfig |
setCacheIndexAndFilterBlocks(boolean cacheIndexAndFilterBlocks)
Indicating if we'd put index/filter blocks to the block cache.
|
BlockBasedTableConfig |
setCacheNumShardBits(int blockCacheNumShardBits)
Controls the number of shards for the block cache.
|
BlockBasedTableConfig |
setChecksumType(ChecksumType checksumType)
Sets the checksum type to be used with this table.
|
BlockBasedTableConfig |
setFilter(Filter filter)
Use the specified filter policy to reduce disk reads.
|
BlockBasedTableConfig |
setFormatVersion(int formatVersion)
We currently have three versions:
|
BlockBasedTableConfig |
setHashIndexAllowCollision(boolean hashIndexAllowCollision)
Influence the behavior when kHashSearch is used.
|
BlockBasedTableConfig |
setIndexType(IndexType indexType)
Sets the index type to used with this table.
|
BlockBasedTableConfig |
setNoBlockCache(boolean noBlockCache)
Disable block cache.
|
BlockBasedTableConfig |
setPinL0FilterAndIndexBlocksInCache(boolean pinL0FilterAndIndexBlocksInCache)
Indicating if we'd like to pin L0 index/filter blocks to the block cache.
|
BlockBasedTableConfig |
setWholeKeyFiltering(boolean wholeKeyFiltering)
If true, place whole keys in the filter (not just prefixes).
|
boolean |
wholeKeyFiltering() |
public BlockBasedTableConfig setNoBlockCache(boolean noBlockCache)
nullptr
object.
Default: falsenoBlockCache
- if use block cachepublic boolean noBlockCache()
public BlockBasedTableConfig setBlockCacheSize(long blockCacheSize)
blockCacheSize
- block cache size in bytespublic long blockCacheSize()
public BlockBasedTableConfig setCacheNumShardBits(int blockCacheNumShardBits)
blockCacheNumShardBits
- the number of shard bits. The resulting
number of shards would be 2 ^ numShardBits. Any negative
number means use default settings."public int cacheNumShardBits()
public BlockBasedTableConfig setBlockSize(long blockSize)
blockSize
- block size in bytespublic long blockSize()
public BlockBasedTableConfig setBlockSizeDeviation(int blockSizeDeviation)
blockSizeDeviation
- the deviation to block size allowedpublic int blockSizeDeviation()
public BlockBasedTableConfig setBlockRestartInterval(int restartInterval)
restartInterval
- block restart interval.public int blockRestartInterval()
public BlockBasedTableConfig setWholeKeyFiltering(boolean wholeKeyFiltering)
wholeKeyFiltering
- if enable whole key filteringpublic boolean wholeKeyFiltering()
public BlockBasedTableConfig setFilter(Filter filter)
Filter
should not be disposed before options instances
using this filter is disposed. If AbstractNativeReference.dispose()
function is not
called, then filter object will be GC'd automatically.
Filter
instance can be re-used in multiple options
instances.filter
- Filter
Filter Policy java instance.public boolean cacheIndexAndFilterBlocks()
public BlockBasedTableConfig setCacheIndexAndFilterBlocks(boolean cacheIndexAndFilterBlocks)
cacheIndexAndFilterBlocks
- and filter blocks should be put in block cache.public boolean pinL0FilterAndIndexBlocksInCache()
public BlockBasedTableConfig setPinL0FilterAndIndexBlocksInCache(boolean pinL0FilterAndIndexBlocksInCache)
pinL0FilterAndIndexBlocksInCache
- pin blocks in block cachepublic boolean hashIndexAllowCollision()
public BlockBasedTableConfig setHashIndexAllowCollision(boolean hashIndexAllowCollision)
hashIndexAllowCollision
- points out if hash collisions should be allowed.public long blockCacheCompressedSize()
public BlockBasedTableConfig setBlockCacheCompressedSize(long blockCacheCompressedSize)
blockCacheCompressedSize
- of compressed block cache.public int blockCacheCompressedNumShardBits()
public BlockBasedTableConfig setBlockCacheCompressedNumShardBits(int blockCacheCompressedNumShardBits)
blockCacheCompressedNumShardBits
- the number of shard bits. The resulting
number of shards would be 2 ^ numShardBits. Any negative
number means use default settings."public BlockBasedTableConfig setChecksumType(ChecksumType checksumType)
checksumType
- ChecksumType
value.public ChecksumType checksumType()
public BlockBasedTableConfig setIndexType(IndexType indexType)
indexType
- IndexType
valuepublic IndexType indexType()
public BlockBasedTableConfig setFormatVersion(int formatVersion)
We currently have three versions:
This option only affects newly written tables. When reading existing tables, the information about version is read from the footer.
formatVersion
- integer representing the version to be used.public int formatVersion()
setFormatVersion(int)
.protected long newTableFactoryHandle()
TableFormatConfig
This function should only be called by Options.setTableFormatConfig(), which will create a c++ shared-pointer to the c++ TableFactory that associated with the Java TableFormatConfig.
newTableFactoryHandle
in class TableFormatConfig