From 642ac9d8ab56826d634c243059c39b5a0dbe3206 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Fri, 7 Nov 2014 15:08:12 -0800 Subject: [PATCH] Fixed compile error in db/compaction.cc and db/compaction_picker.cc Summary: Fixed compile error in db/compaction.cc and db/compaction_picker.cc Test Plan: make --- db/compaction.cc | 2 +- db/compaction_picker.cc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/compaction.cc b/db/compaction.cc index 00513f533..7a8881479 100644 --- a/db/compaction.cc +++ b/db/compaction.cc @@ -89,7 +89,7 @@ Compaction::Compaction(VersionStorageInfo* vstorage, max_output_file_size_(options.output_file_size_limit), max_grandparent_overlap_bytes_(max_grandparent_overlap_bytes), input_version_(nullptr), // TODO(yhchiang): set it later - number_levels_(vstorage->NumberLevels()), + number_levels_(vstorage->num_levels()), cfd_(nullptr), output_compression_(options.compression), seek_compaction_(false), diff --git a/db/compaction_picker.cc b/db/compaction_picker.cc index f5207748b..04d04dc16 100644 --- a/db/compaction_picker.cc +++ b/db/compaction_picker.cc @@ -201,7 +201,7 @@ Compaction* CompactionPicker::FormCompaction( int output_level, VersionStorageInfo* vstorage, const MutableCFOptions& mutable_cf_options) const { uint64_t max_grandparent_overlap_bytes = - output_level + 1 < vstorage->NumberLevels() ? + output_level + 1 < vstorage->num_levels() ? mutable_cf_options.MaxGrandParentOverlapBytes(output_level + 1) : std::numeric_limits::max(); assert(input_files.size()); @@ -221,7 +221,7 @@ Compaction* CompactionPicker::FormCompaction( // the oldest file is involved. c->SetupBottomMostLevel( vstorage, - (output_level == vstorage->NumberLevels() - 1), + (output_level == vstorage->num_levels() - 1), (output_level == 0)); return c; } @@ -238,12 +238,12 @@ Status CompactionPicker::GetCompactionInputsFromFileNumbers( assert(input_files); autovector matched_input_files; - matched_input_files.resize(vstorage->NumberLevels()); + matched_input_files.resize(vstorage->num_levels()); int first_non_empty_level = -1; int last_non_empty_level = -1; // TODO(yhchiang): use a lazy-initialized mapping from // file_number to FileMetaData in Version. - for (int level = 0; level < vstorage->NumberLevels(); ++level) { + for (int level = 0; level < vstorage->num_levels(); ++level) { for (auto file : vstorage->LevelFiles(level)) { auto iter = input_set->find(file->fd.GetNumber()); if (iter != input_set->end()) {