@ -26,6 +26,65 @@
namespace rocksdb {
ColumnFamilyOptions BuildColumnFamilyOptions (
const ColumnFamilyOptions & options ,
const MutableCFOptions & mutable_cf_options ) {
ColumnFamilyOptions cf_opts ( options ) ;
// Memtable related options
cf_opts . write_buffer_size = mutable_cf_options . write_buffer_size ;
cf_opts . max_write_buffer_number = mutable_cf_options . max_write_buffer_number ;
cf_opts . arena_block_size = mutable_cf_options . arena_block_size ;
cf_opts . memtable_prefix_bloom_size_ratio =
mutable_cf_options . memtable_prefix_bloom_size_ratio ;
cf_opts . memtable_huge_page_size = mutable_cf_options . memtable_huge_page_size ;
cf_opts . max_successive_merges = mutable_cf_options . max_successive_merges ;
cf_opts . inplace_update_num_locks =
mutable_cf_options . inplace_update_num_locks ;
// Compaction related options
cf_opts . disable_auto_compactions =
mutable_cf_options . disable_auto_compactions ;
cf_opts . level0_file_num_compaction_trigger =
mutable_cf_options . level0_file_num_compaction_trigger ;
cf_opts . level0_slowdown_writes_trigger =
mutable_cf_options . level0_slowdown_writes_trigger ;
cf_opts . level0_stop_writes_trigger =
mutable_cf_options . level0_stop_writes_trigger ;
cf_opts . max_compaction_bytes = mutable_cf_options . max_compaction_bytes ;
cf_opts . target_file_size_base = mutable_cf_options . target_file_size_base ;
cf_opts . target_file_size_multiplier =
mutable_cf_options . target_file_size_multiplier ;
cf_opts . max_bytes_for_level_base =
mutable_cf_options . max_bytes_for_level_base ;
cf_opts . max_bytes_for_level_multiplier =
mutable_cf_options . max_bytes_for_level_multiplier ;
cf_opts . max_bytes_for_level_multiplier_additional . clear ( ) ;
for ( auto value :
mutable_cf_options . max_bytes_for_level_multiplier_additional ) {
cf_opts . max_bytes_for_level_multiplier_additional . emplace_back ( value ) ;
}
cf_opts . verify_checksums_in_compaction =
mutable_cf_options . verify_checksums_in_compaction ;
// Misc options
cf_opts . max_sequential_skip_in_iterations =
mutable_cf_options . max_sequential_skip_in_iterations ;
cf_opts . paranoid_file_checks = mutable_cf_options . paranoid_file_checks ;
cf_opts . report_bg_io_stats = mutable_cf_options . report_bg_io_stats ;
cf_opts . compression = mutable_cf_options . compression ;
cf_opts . min_partial_merge_operands =
mutable_cf_options . min_partial_merge_operands ;
cf_opts . table_factory = options . table_factory ;
// TODO(yhchiang): find some way to handle the following derived options
// * max_file_size
return cf_opts ;
}
# ifndef ROCKSDB_LITE
bool isSpecialChar ( const char c ) {
if ( c = = ' \\ ' | | c = = ' # ' | | c = = ' : ' | | c = = ' \r ' | | c = = ' \n ' ) {
@ -1367,60 +1426,6 @@ Status GetTableFactoryFromMap(
return Status : : OK ( ) ;
}
ColumnFamilyOptions BuildColumnFamilyOptions (
const Options & options , const MutableCFOptions & mutable_cf_options ) {
ColumnFamilyOptions cf_opts ( options ) ;
// Memtable related options
cf_opts . write_buffer_size = mutable_cf_options . write_buffer_size ;
cf_opts . max_write_buffer_number = mutable_cf_options . max_write_buffer_number ;
cf_opts . arena_block_size = mutable_cf_options . arena_block_size ;
cf_opts . memtable_prefix_bloom_size_ratio =
mutable_cf_options . memtable_prefix_bloom_size_ratio ;
cf_opts . memtable_huge_page_size = mutable_cf_options . memtable_huge_page_size ;
cf_opts . max_successive_merges = mutable_cf_options . max_successive_merges ;
cf_opts . inplace_update_num_locks =
mutable_cf_options . inplace_update_num_locks ;
// Compaction related options
cf_opts . disable_auto_compactions =
mutable_cf_options . disable_auto_compactions ;
cf_opts . level0_file_num_compaction_trigger =
mutable_cf_options . level0_file_num_compaction_trigger ;
cf_opts . level0_slowdown_writes_trigger =
mutable_cf_options . level0_slowdown_writes_trigger ;
cf_opts . level0_stop_writes_trigger =
mutable_cf_options . level0_stop_writes_trigger ;
cf_opts . max_compaction_bytes = mutable_cf_options . max_compaction_bytes ;
cf_opts . target_file_size_base = mutable_cf_options . target_file_size_base ;
cf_opts . target_file_size_multiplier =
mutable_cf_options . target_file_size_multiplier ;
cf_opts . max_bytes_for_level_base =
mutable_cf_options . max_bytes_for_level_base ;
cf_opts . max_bytes_for_level_multiplier =
mutable_cf_options . max_bytes_for_level_multiplier ;
cf_opts . max_bytes_for_level_multiplier_additional . clear ( ) ;
for ( auto value :
mutable_cf_options . max_bytes_for_level_multiplier_additional ) {
cf_opts . max_bytes_for_level_multiplier_additional . emplace_back ( value ) ;
}
cf_opts . verify_checksums_in_compaction =
mutable_cf_options . verify_checksums_in_compaction ;
// Misc options
cf_opts . max_sequential_skip_in_iterations =
mutable_cf_options . max_sequential_skip_in_iterations ;
cf_opts . paranoid_file_checks = mutable_cf_options . paranoid_file_checks ;
cf_opts . report_bg_io_stats = mutable_cf_options . report_bg_io_stats ;
cf_opts . table_factory = options . table_factory ;
// TODO(yhchiang): find some way to handle the following derived options
// * max_file_size
return cf_opts ;
}
# endif // !ROCKSDB_LITE
} // namespace rocksdb