C API: Add some block based table options

Summary: Closes https://github.com/facebook/rocksdb/pull/3159

Differential Revision: D6428220

Pulled By: sagar0

fbshipit-source-id: 60508d09b5281f54b907a1c40e9631fc08343131
This commit is contained in:
kapitan-k 2017-11-28 14:09:17 -08:00 committed by Facebook Github Bot
parent b45fbc1175
commit 75d57a5d53
2 changed files with 40 additions and 1 deletions

26
db/c.cc
View File

@ -1826,6 +1826,26 @@ void rocksdb_block_based_options_set_block_restart_interval(
options->rep.block_restart_interval = block_restart_interval; options->rep.block_restart_interval = block_restart_interval;
} }
void rocksdb_block_based_options_set_index_block_restart_interval(
rocksdb_block_based_table_options_t* options, int index_block_restart_interval) {
options->rep.index_block_restart_interval = index_block_restart_interval;
}
void rocksdb_block_based_options_set_metadata_block_size(
rocksdb_block_based_table_options_t* options, uint64_t metadata_block_size) {
options->rep.metadata_block_size = metadata_block_size;
}
void rocksdb_block_based_options_set_partition_filters(
rocksdb_block_based_table_options_t* options, unsigned char partition_filters) {
options->rep.partition_filters = partition_filters;
}
void rocksdb_block_based_options_set_use_delta_encoding(
rocksdb_block_based_table_options_t* options, unsigned char use_delta_encoding) {
options->rep.use_delta_encoding = use_delta_encoding;
}
void rocksdb_block_based_options_set_filter_policy( void rocksdb_block_based_options_set_filter_policy(
rocksdb_block_based_table_options_t* options, rocksdb_block_based_table_options_t* options,
rocksdb_filterpolicy_t* filter_policy) { rocksdb_filterpolicy_t* filter_policy) {
@ -1879,6 +1899,11 @@ void rocksdb_block_based_options_set_cache_index_and_filter_blocks(
options->rep.cache_index_and_filter_blocks = v; options->rep.cache_index_and_filter_blocks = v;
} }
void rocksdb_block_based_options_set_cache_index_and_filter_blocks_with_high_priority(
rocksdb_block_based_table_options_t* options, unsigned char v) {
options->rep.cache_index_and_filter_blocks_with_high_priority = v;
}
void rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache( void rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache(
rocksdb_block_based_table_options_t* options, unsigned char v) { rocksdb_block_based_table_options_t* options, unsigned char v) {
options->rep.pin_l0_filter_and_index_blocks_in_cache = v; options->rep.pin_l0_filter_and_index_blocks_in_cache = v;
@ -1893,7 +1918,6 @@ void rocksdb_options_set_block_based_table_factory(
} }
} }
rocksdb_cuckoo_table_options_t* rocksdb_cuckoo_table_options_t*
rocksdb_cuckoo_options_create() { rocksdb_cuckoo_options_create() {
return new rocksdb_cuckoo_table_options_t; return new rocksdb_cuckoo_table_options_t;

View File

@ -625,6 +625,18 @@ rocksdb_block_based_options_set_block_size_deviation(
extern ROCKSDB_LIBRARY_API void extern ROCKSDB_LIBRARY_API void
rocksdb_block_based_options_set_block_restart_interval( rocksdb_block_based_options_set_block_restart_interval(
rocksdb_block_based_table_options_t* options, int block_restart_interval); rocksdb_block_based_table_options_t* options, int block_restart_interval);
extern ROCKSDB_LIBRARY_API void
rocksdb_block_based_options_set_index_block_restart_interval(
rocksdb_block_based_table_options_t* options, int index_block_restart_interval);
extern ROCKSDB_LIBRARY_API void
rocksdb_block_based_options_set_metadata_block_size(
rocksdb_block_based_table_options_t* options, uint64_t metadata_block_size);
extern ROCKSDB_LIBRARY_API void
rocksdb_block_based_options_set_partition_filters(
rocksdb_block_based_table_options_t* options, unsigned char partition_filters);
extern ROCKSDB_LIBRARY_API void
rocksdb_block_based_options_set_use_delta_encoding(
rocksdb_block_based_table_options_t* options, unsigned char use_delta_encoding);
extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_filter_policy( extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_filter_policy(
rocksdb_block_based_table_options_t* options, rocksdb_block_based_table_options_t* options,
rocksdb_filterpolicy_t* filter_policy); rocksdb_filterpolicy_t* filter_policy);
@ -655,6 +667,9 @@ extern ROCKSDB_LIBRARY_API void
rocksdb_block_based_options_set_cache_index_and_filter_blocks( rocksdb_block_based_options_set_cache_index_and_filter_blocks(
rocksdb_block_based_table_options_t*, unsigned char); rocksdb_block_based_table_options_t*, unsigned char);
extern ROCKSDB_LIBRARY_API void extern ROCKSDB_LIBRARY_API void
rocksdb_block_based_options_set_cache_index_and_filter_blocks_with_high_priority(
rocksdb_block_based_table_options_t*, unsigned char);
extern ROCKSDB_LIBRARY_API void
rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache( rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache(
rocksdb_block_based_table_options_t*, unsigned char); rocksdb_block_based_table_options_t*, unsigned char);
extern ROCKSDB_LIBRARY_API void rocksdb_options_set_block_based_table_factory( extern ROCKSDB_LIBRARY_API void rocksdb_options_set_block_based_table_factory(