@@ -1107,71 +1107,24 @@ Status BlockBasedTable::PrefetchIndexAndFilterBlocks(
1107
1107
// Find filter handle and filter type
1108
1108
if (rep_->filter_policy ) {
1109
1109
auto name = rep_->filter_policy ->CompatibilityName ();
1110
- bool builtin_compatible =
1111
- strcmp (name, BuiltinFilterPolicy::kCompatibilityName ()) == 0 ;
1112
-
1113
1110
for (const auto & [filter_type, prefix] :
1114
1111
{std::make_pair (Rep::FilterType::kFullFilter , kFullFilterBlockPrefix ),
1115
1112
std::make_pair (Rep::FilterType::kPartitionedFilter ,
1116
1113
kPartitionedFilterBlockPrefix ),
1117
1114
std::make_pair (Rep::FilterType::kNoFilter ,
1118
1115
kObsoleteFilterBlockPrefix )}) {
1119
- if (builtin_compatible) {
1120
- // This code is only here to deal with a hiccup in early 7.0.x where
1121
- // there was an unintentional name change in the SST files metadata.
1122
- // It should be OK to remove this in the future (late 2022) and just
1123
- // have the 'else' code.
1124
- // NOTE: the test:: names below are likely not needed but included
1125
- // out of caution
1126
- static const std::unordered_set<std::string> kBuiltinNameAndAliases = {
1127
- BuiltinFilterPolicy::kCompatibilityName (),
1128
- test::LegacyBloomFilterPolicy::kClassName (),
1129
- test::FastLocalBloomFilterPolicy::kClassName (),
1130
- test::Standard128RibbonFilterPolicy::kClassName (),
1131
- " rocksdb.internal.DeprecatedBlockBasedBloomFilter" ,
1132
- BloomFilterPolicy::kClassName (),
1133
- RibbonFilterPolicy::kClassName (),
1134
- };
1135
-
1136
- // For efficiency, do a prefix seek and see if the first match is
1137
- // good.
1138
- meta_iter->Seek (prefix);
1139
- if (meta_iter->status ().ok () && meta_iter->Valid ()) {
1140
- Slice key = meta_iter->key ();
1141
- if (key.starts_with (prefix)) {
1142
- key.remove_prefix (prefix.size ());
1143
- if (kBuiltinNameAndAliases .find (key.ToString ()) !=
1144
- kBuiltinNameAndAliases .end ()) {
1145
- Slice v = meta_iter->value ();
1146
- Status s = rep_->filter_handle .DecodeFrom (&v);
1147
- if (s.ok ()) {
1148
- rep_->filter_type = filter_type;
1149
- if (filter_type == Rep::FilterType::kNoFilter ) {
1150
- ROCKS_LOG_WARN (rep_->ioptions .logger ,
1151
- " Detected obsolete filter type in %s. Read "
1152
- " performance might suffer until DB is fully "
1153
- " re-compacted." ,
1154
- rep_->file ->file_name ().c_str ());
1155
- }
1156
- break ;
1157
- }
1158
- }
1159
- }
1160
- }
1161
- } else {
1162
- std::string filter_block_key = prefix + name;
1163
- if (FindMetaBlock (meta_iter, filter_block_key, &rep_->filter_handle )
1164
- .ok ()) {
1165
- rep_->filter_type = filter_type;
1166
- if (filter_type == Rep::FilterType::kNoFilter ) {
1167
- ROCKS_LOG_WARN (
1168
- rep_->ioptions .logger ,
1169
- " Detected obsolete filter type in %s. Read performance might "
1170
- " suffer until DB is fully re-compacted." ,
1171
- rep_->file ->file_name ().c_str ());
1172
- }
1173
- break ;
1116
+ std::string filter_block_key = prefix + name;
1117
+ if (FindMetaBlock (meta_iter, filter_block_key, &rep_->filter_handle )
1118
+ .ok ()) {
1119
+ rep_->filter_type = filter_type;
1120
+ if (filter_type == Rep::FilterType::kNoFilter ) {
1121
+ ROCKS_LOG_WARN (
1122
+ rep_->ioptions .logger ,
1123
+ " Detected obsolete filter type in %s. Read performance might "
1124
+ " suffer until DB is fully re-compacted." ,
1125
+ rep_->file ->file_name ().c_str ());
1174
1126
}
1127
+ break ;
1175
1128
}
1176
1129
}
1177
1130
}
0 commit comments