diff --git a/java/src/test/java/org/rocksdb/OptionsUtilTest.java b/java/src/test/java/org/rocksdb/OptionsUtilTest.java index 23949ac066..e14fb58fa6 100644 --- a/java/src/test/java/org/rocksdb/OptionsUtilTest.java +++ b/java/src/test/java/org/rocksdb/OptionsUtilTest.java @@ -358,6 +358,7 @@ public class OptionsUtilTest { assertThat(actual.metadataBlockSize()).isEqualTo(expected.metadataBlockSize()); assertThat(actual.partitionFilters()).isEqualTo(expected.partitionFilters()); assertThat(actual.optimizeFiltersForMemory()).isEqualTo(expected.optimizeFiltersForMemory()); + assertThat(actual.useDeltaEncoding()).isEqualTo(expected.useDeltaEncoding()); assertThat(actual.wholeKeyFiltering()).isEqualTo(expected.wholeKeyFiltering()); assertThat(actual.verifyCompression()).isEqualTo(expected.verifyCompression()); assertThat(actual.readAmpBytesPerBit()).isEqualTo(expected.readAmpBytesPerBit()); @@ -370,9 +371,5 @@ public class OptionsUtilTest { } else { assertThat(expected.filterPolicy().equals(actual.filterPolicy())); } - - // not currently persisted - always true when read from options - // this test will fail, and need repaired, if and when "useDeltaEncoding" is persisted. - assertThat(actual.useDeltaEncoding()).isEqualTo(true); } } diff --git a/options/options_settable_test.cc b/options/options_settable_test.cc index 646f8487c6..20c746ac31 100644 --- a/options/options_settable_test.cc +++ b/options/options_settable_test.cc @@ -157,8 +157,6 @@ TEST_F(OptionsSettableTest, BlockBasedTableOptionsAllFieldsSettable) { // GetBlockBasedTableOptionsFromString(). bbto = new (bbto_ptr) BlockBasedTableOptions(); FillWithSpecialChar(bbto_ptr, sizeof(BlockBasedTableOptions), kBbtoExcluded); - // This option is not setable: - bbto->use_delta_encoding = true; char* new_bbto_ptr = new char[sizeof(BlockBasedTableOptions)]; BlockBasedTableOptions* new_bbto = @@ -191,6 +189,7 @@ TEST_F(OptionsSettableTest, BlockBasedTableOptionsAllFieldsSettable) { "metadata_block_size=1024;" "partition_filters=false;" "optimize_filters_for_memory=true;" + "use_delta_encoding=true;" "index_block_restart_interval=4;" "filter_policy=bloomfilter:4:true;whole_key_filtering=1;detect_filter_" "construct_corruption=false;" diff --git a/table/block_based/block_based_table_factory.cc b/table/block_based/block_based_table_factory.cc index 67b8f704b4..6da594c10d 100644 --- a/table/block_based/block_based_table_factory.cc +++ b/table/block_based/block_based_table_factory.cc @@ -308,9 +308,10 @@ static std::unordered_map {offsetof(struct BlockBasedTableOptions, optimize_filters_for_memory), OptionType::kBoolean, OptionVerificationType::kNormal, OptionTypeFlags::kNone}}, - // TODO "use_delta_encoding" has not been persisted - - // this may have been an omission, but changing this now might be a - // breaker + {"use_delta_encoding", + {offsetof(struct BlockBasedTableOptions, use_delta_encoding), + OptionType::kBoolean, OptionVerificationType::kNormal, + OptionTypeFlags::kNone}}, {"filter_policy", OptionTypeInfo::AsCustomSharedPtr( offsetof(struct BlockBasedTableOptions, filter_policy),