Package org.rocksdb
Class HashSkipListMemTableConfig
- java.lang.Object
-
- org.rocksdb.MemTableConfig
-
- org.rocksdb.HashSkipListMemTableConfig
-
public class HashSkipListMemTableConfig extends MemTableConfig
The config for hash skip-list mem-table representation. Such mem-table representation contains a fix-sized array of buckets, where each bucket points to a skiplist (or null if the bucket is empty). Note that since this mem-table representation relies on the key prefix, it is required to invoke one of the usePrefixExtractor functions to specify how to extract key prefix given a key. If proper prefix-extractor is not set, then RocksDB will use the default memtable representation (SkipList) instead and post a warning in the LOG.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_BRANCHING_FACTORstatic intDEFAULT_BUCKET_COUNTstatic intDEFAULT_HEIGHT
-
Constructor Summary
Constructors Constructor Description HashSkipListMemTableConfig()HashSkipListMemTableConfig constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intbranchingFactor()longbucketCount()intheight()protected longnewMemTableFactoryHandle()This function should only be called by Options.setMemTableConfig(), which will create a c++ shared-pointer to the c++ MemTableRepFactory that associated with the Java MemTableConfig.HashSkipListMemTableConfigsetBranchingFactor(int bf)Set the branching factor used in the hash skip-list memtable.HashSkipListMemTableConfigsetBucketCount(long count)Set the number of hash buckets used in the hash skiplist memtable.HashSkipListMemTableConfigsetHeight(int height)Set the height of the skip list.
-
-
-
Field Detail
-
DEFAULT_BUCKET_COUNT
public static final int DEFAULT_BUCKET_COUNT
- See Also:
- Constant Field Values
-
DEFAULT_BRANCHING_FACTOR
public static final int DEFAULT_BRANCHING_FACTOR
- See Also:
- Constant Field Values
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT
- See Also:
- Constant Field Values
-
-
Method Detail
-
setBucketCount
public HashSkipListMemTableConfig setBucketCount(long count)
Set the number of hash buckets used in the hash skiplist memtable. Default = 1000000.- Parameters:
count- the number of hash buckets used in the hash skiplist memtable.- Returns:
- the reference to the current HashSkipListMemTableConfig.
-
bucketCount
public long bucketCount()
- Returns:
- the number of hash buckets
-
setHeight
public HashSkipListMemTableConfig setHeight(int height)
Set the height of the skip list. Default = 4.- Parameters:
height- height to set.- Returns:
- the reference to the current HashSkipListMemTableConfig.
-
height
public int height()
- Returns:
- the height of the skip list.
-
setBranchingFactor
public HashSkipListMemTableConfig setBranchingFactor(int bf)
Set the branching factor used in the hash skip-list memtable. This factor controls the probabilistic size ratio between adjacent links in the skip list.- Parameters:
bf- the probabilistic size ratio between adjacent link lists in the skip list.- Returns:
- the reference to the current HashSkipListMemTableConfig.
-
branchingFactor
public int branchingFactor()
- Returns:
- branching factor, the probabilistic size ratio between adjacent links in the skip list.
-
newMemTableFactoryHandle
protected long newMemTableFactoryHandle()
Description copied from class:MemTableConfigThis function should only be called by Options.setMemTableConfig(), which will create a c++ shared-pointer to the c++ MemTableRepFactory that associated with the Java MemTableConfig.- Specified by:
newMemTableFactoryHandlein classMemTableConfig- Returns:
- native handle address to native memory table instance.
- See Also:
Options.setMemTableConfig(MemTableConfig)
-
-