make LevelFileNumIterator and LevelFileIteratorState anonymous

Summary: No need to expose them in .h

Test Plan: make release

Reviewers: igor, yhchiang, rven, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D27645
main
Lei Jin 10 years ago
parent eb357af58c
commit efa2fb33b0
  1. 12
      db/version_set.cc
  2. 3
      db/version_set.h

@ -417,12 +417,14 @@ bool SomeFileOverlapsRange(
return !BeforeFile(ucmp, largest_user_key, &file_level.files[index]); return !BeforeFile(ucmp, largest_user_key, &file_level.files[index]);
} }
namespace {
// An internal iterator. For a given version/level pair, yields // An internal iterator. For a given version/level pair, yields
// information about the files in the level. For a given entry, key() // information about the files in the level. For a given entry, key()
// is the largest key that occurs in the file, and value() is an // is the largest key that occurs in the file, and value() is an
// 16-byte value containing the file number and file size, both // 16-byte value containing the file number and file size, both
// encoded using EncodeFixed64. // encoded using EncodeFixed64.
class Version::LevelFileNumIterator : public Iterator { class LevelFileNumIterator : public Iterator {
public: public:
LevelFileNumIterator(const InternalKeyComparator& icmp, LevelFileNumIterator(const InternalKeyComparator& icmp,
const LevelFilesBrief* flevel) const LevelFilesBrief* flevel)
@ -473,7 +475,7 @@ class Version::LevelFileNumIterator : public Iterator {
mutable FileDescriptor current_value_; mutable FileDescriptor current_value_;
}; };
class Version::LevelFileIteratorState : public TwoLevelIteratorState { class LevelFileIteratorState : public TwoLevelIteratorState {
public: public:
LevelFileIteratorState(TableCache* table_cache, LevelFileIteratorState(TableCache* table_cache,
const ReadOptions& read_options, const EnvOptions& env_options, const ReadOptions& read_options, const EnvOptions& env_options,
@ -509,6 +511,8 @@ class Version::LevelFileIteratorState : public TwoLevelIteratorState {
bool for_compaction_; bool for_compaction_;
}; };
} // anonymous namespace
Status Version::GetTableProperties(std::shared_ptr<const TableProperties>* tp, Status Version::GetTableProperties(std::shared_ptr<const TableProperties>* tp,
const FileMetaData* file_meta, const FileMetaData* file_meta,
const std::string* fname) { const std::string* fname) {
@ -2811,11 +2815,11 @@ Iterator* VersionSet::MakeInputIterator(Compaction* c) {
} }
} else { } else {
// Create concatenating iterator for the files from this level // Create concatenating iterator for the files from this level
list[num++] = NewTwoLevelIterator(new Version::LevelFileIteratorState( list[num++] = NewTwoLevelIterator(new LevelFileIteratorState(
cfd->table_cache(), read_options, env_options_, cfd->table_cache(), read_options, env_options_,
cfd->internal_comparator(), true /* for_compaction */, cfd->internal_comparator(), true /* for_compaction */,
false /* prefix enabled */), false /* prefix enabled */),
new Version::LevelFileNumIterator(cfd->internal_comparator(), new LevelFileNumIterator(cfd->internal_comparator(),
c->input_levels(which))); c->input_levels(which)));
} }
} }

@ -308,9 +308,6 @@ class Version {
friend class DBImpl; friend class DBImpl;
friend class InternalStats; friend class InternalStats;
class LevelFileNumIterator;
class LevelFileIteratorState;
bool PrefixMayMatch(const ReadOptions& read_options, Iterator* level_iter, bool PrefixMayMatch(const ReadOptions& read_options, Iterator* level_iter,
const Slice& internal_prefix) const; const Slice& internal_prefix) const;

Loading…
Cancel
Save