From e37dd216f9384bfdabc6760fa296e8ee28c79d30 Mon Sep 17 00:00:00 2001 From: Kai Liu Date: Fri, 11 Apr 2014 13:55:26 -0700 Subject: [PATCH] Index type doesn't have to be persisted Summary: With the recent changes, there is no need to check the property block about the index block type. If user want to use it, they don't really need any disk format change; everything happens in the fly. Also another team encountered an error while reading the index type from properties. Test Plan: ran all the tests Reviewers: sdong CC: Task ID: # Blame Rev: --- table/block_based_table_reader.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/table/block_based_table_reader.cc b/table/block_based_table_reader.cc index 4e827bcd0..656a3c79e 100644 --- a/table/block_based_table_reader.cc +++ b/table/block_based_table_reader.cc @@ -1030,15 +1030,7 @@ bool BlockBasedTable::TEST_KeyInCache(const ReadOptions& options, Status BlockBasedTable::CreateIndexReader(IndexReader** index_reader) { // Some old version of block-based tables don't have index type present in // table properties. If that's the case we can safely use the kBinarySearch. - auto index_type = BlockBasedTableOptions::kBinarySearch; - if (rep_->table_properties) { - auto& props = rep_->table_properties->user_collected_properties; - auto pos = props.find(BlockBasedTablePropertyNames::kIndexType); - if (pos != props.end()) { - index_type = static_cast( - DecodeFixed32(pos->second.c_str())); - } - } + auto index_type = rep_->index_type; auto file = rep_->file.get(); const auto& index_handle = rep_->index_handle;