Package org.rocksdb
Class HashLinkedListMemTableConfig
java.lang.Object
org.rocksdb.MemTableConfig
org.rocksdb.HashLinkedListMemTableConfig
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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final longstatic final intstatic final longstatic final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the number of buckets that will be used in the memtable created based on this config.intReturns the maximum number of entries in one bucket before logging starts.longReturns the size value of hugePageTlbSize.booleanReturns information about logging the distribution of number of entries on flush.protected longThis 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.setBucketCount(long count) Set the number of buckets in the fixed-size array used in the hash linked-list mem-table.setBucketEntriesLoggingThreshold(int threshold) If number of entries in one bucket exceeds that setting, log about it.setHugePageTlbSize(long size) Set the size of huge tlb or allocate the hashtable bytes from malloc ifsize <= 0.setIfLogBucketDistWhenFlush(boolean logDistribution) If true the distrubition of number of entries will be logged.setThresholdUseSkiplist(int threshold) Set maximum number of entries in one bucket.intReturns entries per bucket threshold before LinkedList is replaced by SkipList usage for that bucket.
-
Field Details
-
DEFAULT_BUCKET_COUNT
public static final long DEFAULT_BUCKET_COUNT- See Also:
-
DEFAULT_HUGE_PAGE_TLB_SIZE
public static final long DEFAULT_HUGE_PAGE_TLB_SIZE- See Also:
-
DEFAULT_BUCKET_ENTRIES_LOG_THRES
public static final int DEFAULT_BUCKET_ENTRIES_LOG_THRES- See Also:
-
DEFAULT_IF_LOG_BUCKET_DIST_WHEN_FLUSH
public static final boolean DEFAULT_IF_LOG_BUCKET_DIST_WHEN_FLUSH- See Also:
-
DEFAUL_THRESHOLD_USE_SKIPLIST
public static final int DEFAUL_THRESHOLD_USE_SKIPLIST- See Also:
-
-
Constructor Details
-
HashLinkedListMemTableConfig
public HashLinkedListMemTableConfig()HashLinkedListMemTableConfig constructor
-
-
Method Details
-
setBucketCount
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
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
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
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 distribution of number of entries shall be logged.
-
setThresholdUseSkiplist
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:
-