@ -166,47 +166,49 @@ struct PlainTablePropertyNames {
const uint32_t kPlainTableVariableLength = 0 ;
const uint32_t kPlainTableVariableLength = 0 ;
struct PlainTableOptions {
struct PlainTableOptions {
// @user_key_len: plain table has optimization for fix-sized keys, which can be
// @user_key_len: plain table has optimization for fix-sized keys, which can
// specified via user_key_len. Alternatively, you can pass
// be specified via user_key_len. Alternatively, you can pass
// `kPlainTableVariableLength` if your keys have variable
// `kPlainTableVariableLength` if your keys have variable
// lengths.
// lengths.
uint32_t user_key_len = kPlainTableVariableLength ;
uint32_t user_key_len = kPlainTableVariableLength ;
// @bloom_bits_per_key: the number of bits used for bloom filer per prefix. You
// @bloom_bits_per_key: the number of bits used for bloom filer per prefix.
// may disable it by passing a zero.
// You may disable it by passing a zero.
int bloom_bits_per_key = 10 ;
int bloom_bits_per_key = 10 ;
// @hash_table_ratio: the desired utilization of the hash table used for prefix
// @hash_table_ratio: the desired utilization of the hash table used for
// hashing. hash_table_ratio = number of prefixes / #buckets
// prefix hashing.
// in the hash table
// hash_table_ratio = number of prefixes / #buckets in the
double hash_table_ratio = 0.75 ;
// hash table
double hash_table_ratio = 0.75 ;
// @index_sparseness: inside each prefix, need to build one index record for how
// many keys for binary search inside each hash bucket.
// @index_sparseness: inside each prefix, need to build one index record for
// For encoding type kPrefix, the value will be used when
// how many keys for binary search inside each hash bucket.
// writing to determine an interval to rewrite the full key.
// For encoding type kPrefix, the value will be used when
// It will also be used as a suggestion and satisfied when
// writing to determine an interval to rewrite the full
// possible.
// key. It will also be used as a suggestion and satisfied
size_t index_sparseness = 16 ;
// when possible.
size_t index_sparseness = 16 ;
// @huge_page_tlb_size: if <=0, allocate hash indexes and blooms from malloc.
// Otherwise from huge page TLB. The user needs to reserve
// @huge_page_tlb_size: if <=0, allocate hash indexes and blooms from malloc.
// huge pages for it to be allocated, like:
// Otherwise from huge page TLB. The user needs to
// sysctl -w vm.nr_hugepages=20
// reserve huge pages for it to be allocated, like:
// See linux doc Documentation/vm/hugetlbpage.txt
// sysctl -w vm.nr_hugepages=20
size_t huge_page_tlb_size = 0 ;
// See linux doc Documentation/vm/hugetlbpage.txt
size_t huge_page_tlb_size = 0 ;
// @encoding_type: how to encode the keys. See enum EncodingType above for
// the choices. The value will determine how to encode keys
// @encoding_type: how to encode the keys. See enum EncodingType above for
// when writing to a new SST file. This value will be stored
// the choices. The value will determine how to encode keys
// inside the SST file which will be used when reading from the
// when writing to a new SST file. This value will be stored
// file, which makes it possible for users to choose different
// inside the SST file which will be used when reading from
// encoding type when reopening a DB. Files with different
// the file, which makes it possible for users to choose
// encoding types can co-exist in the same DB and can be read.
// different encoding type when reopening a DB. Files with
EncodingType encoding_type = kPlain ;
// different encoding types can co-exist in the same DB and
// can be read.
// @full_scan_mode: mode for reading the whole file one record by one without
EncodingType encoding_type = kPlain ;
// using the index.
// @full_scan_mode: mode for reading the whole file one record by one without
// using the index.
bool full_scan_mode = false ;
bool full_scan_mode = false ;
// @store_index_in_file: compute plain table index and bloom filter during
// @store_index_in_file: compute plain table index and bloom filter during
@ -299,6 +301,10 @@ class TableFactory {
// If the function cannot find a way to sanitize the input DB Options,
// If the function cannot find a way to sanitize the input DB Options,
// a non-ok Status will be returned.
// a non-ok Status will be returned.
virtual Status SanitizeDBOptions ( DBOptions * db_opts ) const = 0 ;
virtual Status SanitizeDBOptions ( DBOptions * db_opts ) const = 0 ;
// Return a string that contains printable format of table configurations.
// RocksDB prints configurations at DB Open().
virtual std : : string GetPrintableTableOptions ( ) const = 0 ;
} ;
} ;
# ifndef ROCKSDB_LITE
# ifndef ROCKSDB_LITE