MCPcopy Create free account
hub / github.com/ElementsProject/elements / NewInternalIterator

Method NewInternalIterator

src/leveldb/db/db_impl.cc:1073–1098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1071} // anonymous namespace
1072
1073Iterator* DBImpl::NewInternalIterator(const ReadOptions& options,
1074 SequenceNumber* latest_snapshot,
1075 uint32_t* seed) {
1076 mutex_.Lock();
1077 *latest_snapshot = versions_->LastSequence();
1078
1079 // Collect together all needed child iterators
1080 std::vector<Iterator*> list;
1081 list.push_back(mem_->NewIterator());
1082 mem_->Ref();
1083 if (imm_ != nullptr) {
1084 list.push_back(imm_->NewIterator());
1085 imm_->Ref();
1086 }
1087 versions_->current()->AddIterators(options, &list);
1088 Iterator* internal_iter =
1089 NewMergingIterator(&internal_comparator_, &list[0], list.size());
1090 versions_->current()->Ref();
1091
1092 IterState* cleanup = new IterState(&mutex_, mem_, imm_, versions_->current());
1093 internal_iter->RegisterCleanup(CleanupIteratorState, cleanup, nullptr);
1094
1095 *seed = ++seed_;
1096 mutex_.Unlock();
1097 return internal_iter;
1098}
1099
1100Iterator* DBImpl::TEST_NewInternalIterator() {
1101 SequenceNumber ignored;

Callers

nothing calls this directly

Calls 11

NewMergingIteratorFunction · 0.85
LockMethod · 0.80
LastSequenceMethod · 0.80
AddIteratorsMethod · 0.80
currentMethod · 0.80
RegisterCleanupMethod · 0.80
UnlockMethod · 0.80
push_backMethod · 0.45
NewIteratorMethod · 0.45
RefMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected