Package org.rocksdb
Class HashLinkedListMemTableConfig
- java.lang.Object
-
- org.rocksdb.MemTableConfig
-
- org.rocksdb.HashLinkedListMemTableConfig
-
public class HashLinkedListMemTableConfig extends MemTableConfig
The config for hash linked list memtable representation Such memtable contains a fix-sized array of buckets, where each bucket points to a sorted singly-linked list (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 intDEFAUL_THRESHOLD_USE_SKIPLISTstatic longDEFAULT_BUCKET_COUNTstatic intDEFAULT_BUCKET_ENTRIES_LOG_THRESstatic longDEFAULT_HUGE_PAGE_TLB_SIZEstatic booleanDEFAULT_IF_LOG_BUCKET_DIST_WHEN_FLUSH
-
Constructor Summary
Constructors Constructor Description HashLinkedListMemTableConfig()HashLinkedListMemTableConfig constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longbucketCount()Returns the number of buckets that will be used in the memtable created based on this config.intbucketEntriesLoggingThreshold()Returns the maximum number of entries in one bucket before logging starts.longhugePageTlbSize()Returns the size value of hugePageTlbSize.booleanifLogBucketDistWhenFlush()Returns information about logging the distribution of number of entries on flush.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.HashLinkedListMemTableConfigsetBucketCount(long count)Set the number of buckets in the fixed-size array used in the hash linked-list mem-table.HashLinkedListMemTableConfigsetBucketEntriesLoggingThreshold(int threshold)If number of entries in one bucket exceeds that setting, log about it.HashLinkedListMemTableConfigsetHugePageTlbSize(long size)Set the size of huge tlb or allocate the hashtable bytes from malloc ifsize <= 0.HashLinkedListMemTableConfigsetIfLogBucketDistWhenFlush(boolean logDistribution)If true the distrubition of number of entries will be logged.HashLinkedListMemTableConfigsetThresholdUseSkiplist(int threshold)Set maximum number of entries in one bucket.intthresholdUseSkiplist()Returns entries per bucket threshold before LinkedList is replaced by SkipList usage for that bucket.
-
-
-
Field Detail
-
DEFAULT_BUCKET_COUNT
public static final long DEFAULT_BUCKET_COUNT
- See Also:
- Constant Field Values
-
DEFAULT_HUGE_PAGE_TLB_SIZE
public static final long DEFAULT_HUGE_PAGE_TLB_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_BUCKET_ENTRIES_LOG_THRES
public static final int DEFAULT_BUCKET_ENTRIES_LOG_THRES
- See Also:
- Constant Field Values
-
DEFAULT_IF_LOG_BUCKET_DIST_WHEN_FLUSH
public static final boolean DEFAULT_IF_LOG_BUCKET_DIST_WHEN_FLUSH
- See Also:
- Constant Field Values
-
DEFAUL_THRESHOLD_USE_SKIPLIST
public static final int DEFAUL_THRESHOLD_USE_SKIPLIST
- See Also:
- Constant Field Values
-
-
Method Detail
-
setBucketCount
public HashLinkedListMemTableConfig setBucketCount(long count)
Set the number of buckets in the fixed-size array used in the hash linked-list mem-table.- Parameters:
count- the number of hash buckets.- Returns:
- the reference to the current HashLinkedListMemTableConfig.
-
bucketCount
public long bucketCount()
Returns the number of buckets that will be used in the memtable created based on this config.- Returns:
- the number of buckets
-
setHugePageTlbSize
public HashLinkedListMemTableConfig setHugePageTlbSize(long size)
Set the size of huge tlb or allocate the hashtable bytes from malloc if
size <= 0.The user needs to reserve huge pages for it to be allocated, like:
sysctl -w vm.nr_hugepages=20See linux documentation/vm/hugetlbpage.txt
- Parameters:
size- if set to<= 0hashtable bytes from malloc- Returns:
- the reference to the current HashLinkedListMemTableConfig.
-
hugePageTlbSize
public long hugePageTlbSize()
Returns the size value of hugePageTlbSize.- Returns:
- the hugePageTlbSize.
-
setBucketEntriesLoggingThreshold
public HashLinkedListMemTableConfig setBucketEntriesLoggingThreshold(int threshold)
If number of entries in one bucket exceeds that setting, log about it.- Parameters:
threshold- - number of entries in a single bucket before logging starts.- Returns:
- the reference to the current HashLinkedListMemTableConfig.
-
bucketEntriesLoggingThreshold
public int bucketEntriesLoggingThreshold()
Returns the maximum number of entries in one bucket before logging starts.- Returns:
- maximum number of entries in one bucket before logging starts.
-
setIfLogBucketDistWhenFlush
public HashLinkedListMemTableConfig setIfLogBucketDistWhenFlush(boolean logDistribution)
If true the distrubition of number of entries will be logged.- Parameters:
logDistribution- - boolean parameter indicating if number of entry distribution shall be logged.- Returns:
- the reference to the current HashLinkedListMemTableConfig.
-
ifLogBucketDistWhenFlush
public boolean ifLogBucketDistWhenFlush()
Returns information about logging the distribution of number of entries on flush.- Returns:
- if distrubtion of number of entries shall be logged.
-
setThresholdUseSkiplist
public HashLinkedListMemTableConfig setThresholdUseSkiplist(int threshold)
Set maximum number of entries in one bucket. Exceeding this val leads to a switch from LinkedList to SkipList.- Parameters:
threshold- maximum number of entries before SkipList is used.- Returns:
- the reference to the current HashLinkedListMemTableConfig.
-
thresholdUseSkiplist
public int thresholdUseSkiplist()
Returns entries per bucket threshold before LinkedList is replaced by SkipList usage for that bucket.- Returns:
- entries per bucket threshold before SkipList is used.
-
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)
-
-