C-API: Expose remaining PlainTableOptions (#11442)

Summary:
Expose the remaining fields of PlainTableOptions as arguments to `rocksdb_options_set_plain_table_factory` in the C API.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11442

Reviewed By: ajkr

Differential Revision: D46786962

Pulled By: hx235

fbshipit-source-id: 8862083dde332bfecc5ff02f9375776ad35c11f5
oxigraph-main
Griffin Smith 1 year ago committed by Facebook GitHub Bot
parent 5187ac2af3
commit bfdc91017c
  1. 15
      db/c.cc
  2. 3
      db/c_test.c
  3. 3
      include/rocksdb/c.h

@ -3770,16 +3770,21 @@ void rocksdb_options_set_hash_link_list_rep(rocksdb_options_t* opt,
ROCKSDB_NAMESPACE::NewHashLinkListRepFactory(bucket_count)); ROCKSDB_NAMESPACE::NewHashLinkListRepFactory(bucket_count));
} }
void rocksdb_options_set_plain_table_factory(rocksdb_options_t* opt, void rocksdb_options_set_plain_table_factory(
uint32_t user_key_len, rocksdb_options_t* opt, uint32_t user_key_len, int bloom_bits_per_key,
int bloom_bits_per_key, double hash_table_ratio, size_t index_sparseness, size_t huge_page_tlb_size,
double hash_table_ratio, char encoding_type, unsigned char full_scan_mode,
size_t index_sparseness) { unsigned char store_index_in_file) {
ROCKSDB_NAMESPACE::PlainTableOptions options; ROCKSDB_NAMESPACE::PlainTableOptions options;
options.user_key_len = user_key_len; options.user_key_len = user_key_len;
options.bloom_bits_per_key = bloom_bits_per_key; options.bloom_bits_per_key = bloom_bits_per_key;
options.hash_table_ratio = hash_table_ratio; options.hash_table_ratio = hash_table_ratio;
options.index_sparseness = index_sparseness; options.index_sparseness = index_sparseness;
options.huge_page_tlb_size = huge_page_tlb_size;
options.encoding_type =
static_cast<ROCKSDB_NAMESPACE::EncodingType>(encoding_type);
options.full_scan_mode = full_scan_mode;
options.store_index_in_file = store_index_in_file;
ROCKSDB_NAMESPACE::TableFactory* factory = ROCKSDB_NAMESPACE::TableFactory* factory =
ROCKSDB_NAMESPACE::NewPlainTableFactory(options); ROCKSDB_NAMESPACE::NewPlainTableFactory(options);

@ -1672,7 +1672,8 @@ int main(int argc, char** argv) {
rocksdb_options_set_prefix_extractor( rocksdb_options_set_prefix_extractor(
options, rocksdb_slicetransform_create_fixed_prefix(3)); options, rocksdb_slicetransform_create_fixed_prefix(3));
rocksdb_options_set_hash_skip_list_rep(options, 5000, 4, 4); rocksdb_options_set_hash_skip_list_rep(options, 5000, 4, 4);
rocksdb_options_set_plain_table_factory(options, 4, 10, 0.75, 16); rocksdb_options_set_plain_table_factory(options, 4, 10, 0.75, 16, 0, 0, 0,
0);
rocksdb_options_set_allow_concurrent_memtable_write(options, 0); rocksdb_options_set_allow_concurrent_memtable_write(options, 0);
db = rocksdb_open(options, dbname, &err); db = rocksdb_open(options, dbname, &err);

@ -1528,7 +1528,8 @@ extern ROCKSDB_LIBRARY_API void rocksdb_options_set_hash_skip_list_rep(
extern ROCKSDB_LIBRARY_API void rocksdb_options_set_hash_link_list_rep( extern ROCKSDB_LIBRARY_API void rocksdb_options_set_hash_link_list_rep(
rocksdb_options_t*, size_t); rocksdb_options_t*, size_t);
extern ROCKSDB_LIBRARY_API void rocksdb_options_set_plain_table_factory( extern ROCKSDB_LIBRARY_API void rocksdb_options_set_plain_table_factory(
rocksdb_options_t*, uint32_t, int, double, size_t); rocksdb_options_t*, uint32_t, int, double, size_t, size_t, char,
unsigned char, unsigned char);
extern ROCKSDB_LIBRARY_API void rocksdb_options_set_min_level_to_compress( extern ROCKSDB_LIBRARY_API void rocksdb_options_set_min_level_to_compress(
rocksdb_options_t* opt, int level); rocksdb_options_t* opt, int level);

Loading…
Cancel
Save