|
|
|
@ -1564,6 +1564,85 @@ int main(int argc, char** argv) { |
|
|
|
|
rocksdb_options_set_max_subcompactions(o, 123456); |
|
|
|
|
CheckCondition(123456 == rocksdb_options_get_max_subcompactions(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_max_background_jobs(o, 2); |
|
|
|
|
CheckCondition(2 == rocksdb_options_get_max_background_jobs(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_max_background_compactions(o, 3); |
|
|
|
|
CheckCondition(3 == rocksdb_options_get_max_background_compactions(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_base_background_compactions(o, 4); |
|
|
|
|
CheckCondition(4 == rocksdb_options_get_base_background_compactions(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_max_background_flushes(o, 5); |
|
|
|
|
CheckCondition(5 == rocksdb_options_get_max_background_flushes(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_max_log_file_size(o, 6); |
|
|
|
|
CheckCondition(6 == rocksdb_options_get_max_log_file_size(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_log_file_time_to_roll(o, 7); |
|
|
|
|
CheckCondition(7 == rocksdb_options_get_log_file_time_to_roll(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_keep_log_file_num(o, 8); |
|
|
|
|
CheckCondition(8 == rocksdb_options_get_keep_log_file_num(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_recycle_log_file_num(o, 9); |
|
|
|
|
CheckCondition(9 == rocksdb_options_get_recycle_log_file_num(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_soft_rate_limit(o, 2.0); |
|
|
|
|
CheckCondition(2.0 == rocksdb_options_get_soft_rate_limit(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_hard_rate_limit(o, 4.0); |
|
|
|
|
CheckCondition(4.0 == rocksdb_options_get_hard_rate_limit(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_soft_pending_compaction_bytes_limit(o, 10); |
|
|
|
|
CheckCondition(10 == |
|
|
|
|
rocksdb_options_get_soft_pending_compaction_bytes_limit(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_hard_pending_compaction_bytes_limit(o, 11); |
|
|
|
|
CheckCondition(11 == |
|
|
|
|
rocksdb_options_get_hard_pending_compaction_bytes_limit(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_rate_limit_delay_max_milliseconds(o, 1); |
|
|
|
|
CheckCondition(1 == |
|
|
|
|
rocksdb_options_get_rate_limit_delay_max_milliseconds(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_max_manifest_file_size(o, 12); |
|
|
|
|
CheckCondition(12 == rocksdb_options_get_max_manifest_file_size(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_table_cache_numshardbits(o, 13); |
|
|
|
|
CheckCondition(13 == rocksdb_options_get_table_cache_numshardbits(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_arena_block_size(o, 14); |
|
|
|
|
CheckCondition(14 == rocksdb_options_get_arena_block_size(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_use_fsync(o, 1); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_use_fsync(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_WAL_ttl_seconds(o, 15); |
|
|
|
|
CheckCondition(15 == rocksdb_options_get_WAL_ttl_seconds(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_WAL_size_limit_MB(o, 16); |
|
|
|
|
CheckCondition(16 == rocksdb_options_get_WAL_size_limit_MB(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_manifest_preallocation_size(o, 17); |
|
|
|
|
CheckCondition(17 == rocksdb_options_get_manifest_preallocation_size(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_allow_mmap_reads(o, 1); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_allow_mmap_reads(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_allow_mmap_writes(o, 1); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_allow_mmap_writes(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_use_direct_reads(o, 1); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_use_direct_reads(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_use_direct_io_for_flush_and_compaction(o, 1); |
|
|
|
|
CheckCondition( |
|
|
|
|
1 == rocksdb_options_get_use_direct_io_for_flush_and_compaction(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_is_fd_close_on_exec(o, 1); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_is_fd_close_on_exec(o)); |
|
|
|
|
|
|
|
|
|
// Create a copy that should be equal to the original.
|
|
|
|
|
rocksdb_options_t* copy; |
|
|
|
|
copy = rocksdb_options_create_copy(o); |
|
|
|
@ -1607,6 +1686,35 @@ int main(int argc, char** argv) { |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_enable_pipelined_write(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_unordered_write(copy)); |
|
|
|
|
CheckCondition(123456 == rocksdb_options_get_max_subcompactions(copy)); |
|
|
|
|
CheckCondition(2 == rocksdb_options_get_max_background_jobs(copy)); |
|
|
|
|
CheckCondition(3 == rocksdb_options_get_max_background_compactions(copy)); |
|
|
|
|
CheckCondition(4 == rocksdb_options_get_base_background_compactions(copy)); |
|
|
|
|
CheckCondition(5 == rocksdb_options_get_max_background_flushes(copy)); |
|
|
|
|
CheckCondition(6 == rocksdb_options_get_max_log_file_size(copy)); |
|
|
|
|
CheckCondition(7 == rocksdb_options_get_log_file_time_to_roll(copy)); |
|
|
|
|
CheckCondition(8 == rocksdb_options_get_keep_log_file_num(copy)); |
|
|
|
|
CheckCondition(9 == rocksdb_options_get_recycle_log_file_num(copy)); |
|
|
|
|
CheckCondition(2.0 == rocksdb_options_get_soft_rate_limit(copy)); |
|
|
|
|
CheckCondition(4.0 == rocksdb_options_get_hard_rate_limit(copy)); |
|
|
|
|
CheckCondition( |
|
|
|
|
10 == rocksdb_options_get_soft_pending_compaction_bytes_limit(copy)); |
|
|
|
|
CheckCondition( |
|
|
|
|
11 == rocksdb_options_get_hard_pending_compaction_bytes_limit(copy)); |
|
|
|
|
CheckCondition(1 == |
|
|
|
|
rocksdb_options_get_rate_limit_delay_max_milliseconds(copy)); |
|
|
|
|
CheckCondition(12 == rocksdb_options_get_max_manifest_file_size(copy)); |
|
|
|
|
CheckCondition(13 == rocksdb_options_get_table_cache_numshardbits(copy)); |
|
|
|
|
CheckCondition(14 == rocksdb_options_get_arena_block_size(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_use_fsync(copy)); |
|
|
|
|
CheckCondition(15 == rocksdb_options_get_WAL_ttl_seconds(copy)); |
|
|
|
|
CheckCondition(16 == rocksdb_options_get_WAL_size_limit_MB(copy)); |
|
|
|
|
CheckCondition(17 == rocksdb_options_get_manifest_preallocation_size(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_allow_mmap_reads(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_allow_mmap_writes(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_use_direct_reads(copy)); |
|
|
|
|
CheckCondition( |
|
|
|
|
1 == rocksdb_options_get_use_direct_io_for_flush_and_compaction(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_is_fd_close_on_exec(copy)); |
|
|
|
|
|
|
|
|
|
// Copies should be independent.
|
|
|
|
|
rocksdb_options_set_allow_ingest_behind(copy, 0); |
|
|
|
@ -1745,6 +1853,115 @@ int main(int argc, char** argv) { |
|
|
|
|
CheckCondition(90001 == rocksdb_options_get_max_subcompactions(copy)); |
|
|
|
|
CheckCondition(123456 == rocksdb_options_get_max_subcompactions(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_max_background_jobs(copy, 12); |
|
|
|
|
CheckCondition(12 == rocksdb_options_get_max_background_jobs(copy)); |
|
|
|
|
CheckCondition(2 == rocksdb_options_get_max_background_jobs(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_max_background_compactions(copy, 13); |
|
|
|
|
CheckCondition(13 == rocksdb_options_get_max_background_compactions(copy)); |
|
|
|
|
CheckCondition(3 == rocksdb_options_get_max_background_compactions(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_base_background_compactions(copy, 14); |
|
|
|
|
CheckCondition(14 == rocksdb_options_get_base_background_compactions(copy)); |
|
|
|
|
CheckCondition(4 == rocksdb_options_get_base_background_compactions(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_max_background_flushes(copy, 15); |
|
|
|
|
CheckCondition(15 == rocksdb_options_get_max_background_flushes(copy)); |
|
|
|
|
CheckCondition(5 == rocksdb_options_get_max_background_flushes(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_max_log_file_size(copy, 16); |
|
|
|
|
CheckCondition(16 == rocksdb_options_get_max_log_file_size(copy)); |
|
|
|
|
CheckCondition(6 == rocksdb_options_get_max_log_file_size(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_log_file_time_to_roll(copy, 17); |
|
|
|
|
CheckCondition(17 == rocksdb_options_get_log_file_time_to_roll(copy)); |
|
|
|
|
CheckCondition(7 == rocksdb_options_get_log_file_time_to_roll(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_keep_log_file_num(copy, 18); |
|
|
|
|
CheckCondition(18 == rocksdb_options_get_keep_log_file_num(copy)); |
|
|
|
|
CheckCondition(8 == rocksdb_options_get_keep_log_file_num(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_recycle_log_file_num(copy, 19); |
|
|
|
|
CheckCondition(19 == rocksdb_options_get_recycle_log_file_num(copy)); |
|
|
|
|
CheckCondition(9 == rocksdb_options_get_recycle_log_file_num(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_soft_rate_limit(copy, 4.0); |
|
|
|
|
CheckCondition(4.0 == rocksdb_options_get_soft_rate_limit(copy)); |
|
|
|
|
CheckCondition(2.0 == rocksdb_options_get_soft_rate_limit(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_hard_rate_limit(copy, 2.0); |
|
|
|
|
CheckCondition(2.0 == rocksdb_options_get_hard_rate_limit(copy)); |
|
|
|
|
CheckCondition(4.0 == rocksdb_options_get_hard_rate_limit(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_soft_pending_compaction_bytes_limit(copy, 110); |
|
|
|
|
CheckCondition( |
|
|
|
|
110 == rocksdb_options_get_soft_pending_compaction_bytes_limit(copy)); |
|
|
|
|
CheckCondition(10 == |
|
|
|
|
rocksdb_options_get_soft_pending_compaction_bytes_limit(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_hard_pending_compaction_bytes_limit(copy, 111); |
|
|
|
|
CheckCondition( |
|
|
|
|
111 == rocksdb_options_get_hard_pending_compaction_bytes_limit(copy)); |
|
|
|
|
CheckCondition(11 == |
|
|
|
|
rocksdb_options_get_hard_pending_compaction_bytes_limit(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_rate_limit_delay_max_milliseconds(copy, 0); |
|
|
|
|
CheckCondition(0 == |
|
|
|
|
rocksdb_options_get_rate_limit_delay_max_milliseconds(copy)); |
|
|
|
|
CheckCondition(1 == |
|
|
|
|
rocksdb_options_get_rate_limit_delay_max_milliseconds(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_max_manifest_file_size(copy, 112); |
|
|
|
|
CheckCondition(112 == rocksdb_options_get_max_manifest_file_size(copy)); |
|
|
|
|
CheckCondition(12 == rocksdb_options_get_max_manifest_file_size(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_table_cache_numshardbits(copy, 113); |
|
|
|
|
CheckCondition(113 == rocksdb_options_get_table_cache_numshardbits(copy)); |
|
|
|
|
CheckCondition(13 == rocksdb_options_get_table_cache_numshardbits(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_arena_block_size(copy, 114); |
|
|
|
|
CheckCondition(114 == rocksdb_options_get_arena_block_size(copy)); |
|
|
|
|
CheckCondition(14 == rocksdb_options_get_arena_block_size(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_use_fsync(copy, 0); |
|
|
|
|
CheckCondition(0 == rocksdb_options_get_use_fsync(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_use_fsync(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_WAL_ttl_seconds(copy, 115); |
|
|
|
|
CheckCondition(115 == rocksdb_options_get_WAL_ttl_seconds(copy)); |
|
|
|
|
CheckCondition(15 == rocksdb_options_get_WAL_ttl_seconds(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_WAL_size_limit_MB(copy, 116); |
|
|
|
|
CheckCondition(116 == rocksdb_options_get_WAL_size_limit_MB(copy)); |
|
|
|
|
CheckCondition(16 == rocksdb_options_get_WAL_size_limit_MB(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_manifest_preallocation_size(copy, 117); |
|
|
|
|
CheckCondition(117 == |
|
|
|
|
rocksdb_options_get_manifest_preallocation_size(copy)); |
|
|
|
|
CheckCondition(17 == rocksdb_options_get_manifest_preallocation_size(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_allow_mmap_reads(copy, 0); |
|
|
|
|
CheckCondition(0 == rocksdb_options_get_allow_mmap_reads(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_allow_mmap_reads(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_allow_mmap_writes(copy, 0); |
|
|
|
|
CheckCondition(0 == rocksdb_options_get_allow_mmap_writes(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_allow_mmap_writes(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_use_direct_reads(copy, 0); |
|
|
|
|
CheckCondition(0 == rocksdb_options_get_use_direct_reads(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_use_direct_reads(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_use_direct_io_for_flush_and_compaction(copy, 0); |
|
|
|
|
CheckCondition( |
|
|
|
|
0 == rocksdb_options_get_use_direct_io_for_flush_and_compaction(copy)); |
|
|
|
|
CheckCondition( |
|
|
|
|
1 == rocksdb_options_get_use_direct_io_for_flush_and_compaction(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_set_is_fd_close_on_exec(copy, 0); |
|
|
|
|
CheckCondition(0 == rocksdb_options_get_is_fd_close_on_exec(copy)); |
|
|
|
|
CheckCondition(1 == rocksdb_options_get_is_fd_close_on_exec(o)); |
|
|
|
|
|
|
|
|
|
rocksdb_options_destroy(copy); |
|
|
|
|
rocksdb_options_destroy(o); |
|
|
|
|
} |
|
|
|
|