@@ -166,47 +166,49 @@ struct PlainTablePropertyNames {
166
166
const uint32_t kPlainTableVariableLength = 0 ;
167
167
168
168
struct PlainTableOptions {
169
- // @user_key_len: plain table has optimization for fix-sized keys, which can be
170
- // specified via user_key_len. Alternatively, you can pass
171
- // `kPlainTableVariableLength` if your keys have variable
172
- // lengths.
173
- uint32_t user_key_len = kPlainTableVariableLength ;
174
-
175
- // @bloom_bits_per_key: the number of bits used for bloom filer per prefix. You
176
- // may disable it by passing a zero.
177
- int bloom_bits_per_key = 10 ;
178
-
179
- // @hash_table_ratio: the desired utilization of the hash table used for prefix
180
- // hashing. hash_table_ratio = number of prefixes / #buckets
181
- // in the hash table
182
- double hash_table_ratio = 0.75 ;
183
-
184
- // @index_sparseness: inside each prefix, need to build one index record for how
185
- // many keys for binary search inside each hash bucket.
186
- // For encoding type kPrefix, the value will be used when
187
- // writing to determine an interval to rewrite the full key.
188
- // It will also be used as a suggestion and satisfied when
189
- // possible.
190
- size_t index_sparseness = 16 ;
191
-
192
- // @huge_page_tlb_size: if <=0, allocate hash indexes and blooms from malloc.
193
- // Otherwise from huge page TLB. The user needs to reserve
194
- // huge pages for it to be allocated, like:
195
- // sysctl -w vm.nr_hugepages=20
196
- // See linux doc Documentation/vm/hugetlbpage.txt
197
- size_t huge_page_tlb_size = 0 ;
198
-
199
- // @encoding_type: how to encode the keys. See enum EncodingType above for
200
- // the choices. The value will determine how to encode keys
201
- // when writing to a new SST file. This value will be stored
202
- // inside the SST file which will be used when reading from the
203
- // file, which makes it possible for users to choose different
204
- // encoding type when reopening a DB. Files with different
205
- // encoding types can co-exist in the same DB and can be read.
206
- EncodingType encoding_type = kPlain ;
207
-
208
- // @full_scan_mode: mode for reading the whole file one record by one without
209
- // using the index.
169
+ // @user_key_len: plain table has optimization for fix-sized keys, which can
170
+ // be specified via user_key_len. Alternatively, you can pass
171
+ // `kPlainTableVariableLength` if your keys have variable
172
+ // lengths.
173
+ uint32_t user_key_len = kPlainTableVariableLength ;
174
+
175
+ // @bloom_bits_per_key: the number of bits used for bloom filer per prefix.
176
+ // You may disable it by passing a zero.
177
+ int bloom_bits_per_key = 10 ;
178
+
179
+ // @hash_table_ratio: the desired utilization of the hash table used for
180
+ // prefix hashing.
181
+ // hash_table_ratio = number of prefixes / #buckets in the
182
+ // hash table
183
+ double hash_table_ratio = 0.75 ;
184
+
185
+ // @index_sparseness: inside each prefix, need to build one index record for
186
+ // how many keys for binary search inside each hash bucket.
187
+ // For encoding type kPrefix, the value will be used when
188
+ // writing to determine an interval to rewrite the full
189
+ // key. It will also be used as a suggestion and satisfied
190
+ // when possible.
191
+ size_t index_sparseness = 16 ;
192
+
193
+ // @huge_page_tlb_size: if <=0, allocate hash indexes and blooms from malloc.
194
+ // Otherwise from huge page TLB. The user needs to
195
+ // reserve huge pages for it to be allocated, like:
196
+ // sysctl -w vm.nr_hugepages=20
197
+ // See linux doc Documentation/vm/hugetlbpage.txt
198
+ size_t huge_page_tlb_size = 0 ;
199
+
200
+ // @encoding_type: how to encode the keys. See enum EncodingType above for
201
+ // the choices. The value will determine how to encode keys
202
+ // when writing to a new SST file. This value will be stored
203
+ // inside the SST file which will be used when reading from
204
+ // the file, which makes it possible for users to choose
205
+ // different encoding type when reopening a DB. Files with
206
+ // different encoding types can co-exist in the same DB and
207
+ // can be read.
208
+ EncodingType encoding_type = kPlain ;
209
+
210
+ // @full_scan_mode: mode for reading the whole file one record by one without
211
+ // using the index.
210
212
bool full_scan_mode = false ;
211
213
212
214
// @store_index_in_file: compute plain table index and bloom filter during
@@ -299,6 +301,10 @@ class TableFactory {
299
301
// If the function cannot find a way to sanitize the input DB Options,
300
302
// a non-ok Status will be returned.
301
303
virtual Status SanitizeDBOptions (DBOptions* db_opts) const = 0;
304
+
305
+ // Return a string that contains printable format of table configurations.
306
+ // RocksDB prints configurations at DB Open().
307
+ virtual std::string GetPrintableTableOptions () const = 0;
302
308
};
303
309
304
310
#ifndef ROCKSDB_LITE
0 commit comments