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 Details

  • Constructor Details

    • HashSkipListMemTableConfig

      public HashSkipListMemTableConfig()
      HashSkipListMemTableConfig constructor
  • Method Details

    • 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: MemTableConfig
      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.
      Specified by:
      newMemTableFactoryHandle in class MemTableConfig
      Returns:
      native handle address to native memory table instance.
      See Also: