mirror of https://github.com/facebook/rocksdb.git
Remove env_ from MergingIterator
Summary: env_ is not used. Compiling for iOS complains. Test Plan: compiles now Reviewers: ljin, haobo, sdong, dhruba Reviewed By: ljin CC: leveldb Differential Revision: https://reviews.facebook.net/D17589
This commit is contained in:
parent
0c1126d4cf
commit
5b345b76cb
|
@ -1238,7 +1238,7 @@ Status DBImpl::WriteLevel0Table(ColumnFamilyData* cfd,
|
|||
(unsigned long)m->GetNextLogNumber());
|
||||
memtables.push_back(m->NewIterator());
|
||||
}
|
||||
Iterator* iter = NewMergingIterator(env_, &cfd->internal_comparator(),
|
||||
Iterator* iter = NewMergingIterator(&cfd->internal_comparator(),
|
||||
&memtables[0], memtables.size());
|
||||
Log(options_.info_log, "Level-0 flush table #%lu: started",
|
||||
(unsigned long)meta.number);
|
||||
|
@ -3211,9 +3211,8 @@ Iterator* DBImpl::NewInternalIterator(const ReadOptions& options,
|
|||
// Collect iterators for files in L0 - Ln
|
||||
super_version->current->AddIterators(options, storage_options_,
|
||||
&iterator_list);
|
||||
Iterator* internal_iter =
|
||||
NewMergingIterator(env_, &cfd->internal_comparator(), &iterator_list[0],
|
||||
iterator_list.size());
|
||||
Iterator* internal_iter = NewMergingIterator(
|
||||
&cfd->internal_comparator(), &iterator_list[0], iterator_list.size());
|
||||
|
||||
IterState* cleanup = new IterState(this, &mutex_, super_version);
|
||||
internal_iter->RegisterCleanup(CleanupIteratorState, cleanup, nullptr);
|
||||
|
@ -3262,8 +3261,8 @@ std::pair<Iterator*, Iterator*> DBImpl::GetTailingIteratorPair(
|
|||
std::vector<Iterator*> list;
|
||||
super_version->imm->AddIterators(options, &list);
|
||||
super_version->current->AddIterators(options, storage_options_, &list);
|
||||
Iterator* immutable_iter = NewMergingIterator(
|
||||
env_, &cfd->internal_comparator(), &list[0], list.size());
|
||||
Iterator* immutable_iter =
|
||||
NewMergingIterator(&cfd->internal_comparator(), &list[0], list.size());
|
||||
|
||||
// create a DBIter that only uses memtable content; see NewIterator()
|
||||
immutable_iter =
|
||||
|
|
|
@ -2617,7 +2617,7 @@ Iterator* VersionSet::MakeInputIterator(Compaction* c) {
|
|||
}
|
||||
assert(num <= space);
|
||||
Iterator* result = NewMergingIterator(
|
||||
env_, &c->column_family_data()->internal_comparator(), list, num);
|
||||
&c->column_family_data()->internal_comparator(), list, num);
|
||||
delete[] list;
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -25,16 +25,14 @@ namespace {
|
|||
|
||||
class MergingIterator : public Iterator {
|
||||
public:
|
||||
MergingIterator(Env* const env, const Comparator* comparator,
|
||||
Iterator** children, int n)
|
||||
MergingIterator(const Comparator* comparator, Iterator** children, int n)
|
||||
: comparator_(comparator),
|
||||
children_(n),
|
||||
current_(nullptr),
|
||||
use_heap_(true),
|
||||
env_(env),
|
||||
direction_(kForward),
|
||||
maxHeap_(NewMaxIterHeap(comparator_)),
|
||||
minHeap_ (NewMinIterHeap(comparator_)) {
|
||||
minHeap_(NewMinIterHeap(comparator_)) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
children_[i].Set(children[i]);
|
||||
}
|
||||
|
@ -230,7 +228,6 @@ class MergingIterator : public Iterator {
|
|||
// This flag is always true for reverse direction, as we always use heap for
|
||||
// the reverse iterating case.
|
||||
bool use_heap_;
|
||||
Env* const env_;
|
||||
// Which direction is the iterator moving?
|
||||
enum Direction {
|
||||
kForward,
|
||||
|
|
|
@ -23,8 +23,7 @@ class Env;
|
|||
// key is present in K child iterators, it will be yielded K times.
|
||||
//
|
||||
// REQUIRES: n >= 0
|
||||
extern Iterator* NewMergingIterator(Env* const env,
|
||||
const Comparator* comparator,
|
||||
extern Iterator* NewMergingIterator(const Comparator* comparator,
|
||||
Iterator** children, int n);
|
||||
|
||||
} // namespace rocksdb
|
||||
|
|
Loading…
Reference in New Issue