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

Method NewIterator

src/leveldb/db/table_cache.cc:78–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78Iterator* TableCache::NewIterator(const ReadOptions& options,
79 uint64_t file_number, uint64_t file_size,
80 Table** tableptr) {
81 if (tableptr != nullptr) {
82 *tableptr = nullptr;
83 }
84
85 Cache::Handle* handle = nullptr;
86 Status s = FindTable(file_number, file_size, &handle);
87 if (!s.ok()) {
88 return NewErrorIterator(s);
89 }
90
91 Table* table = reinterpret_cast<TableAndFile*>(cache_->Value(handle))->table;
92 Iterator* result = table->NewIterator(options);
93 result->RegisterCleanup(&UnrefEntry, cache_, handle);
94 if (tableptr != nullptr) {
95 *tableptr = table;
96 }
97 return result;
98}
99
100Status TableCache::Get(const ReadOptions& options, uint64_t file_number,
101 uint64_t file_size, const Slice& k, void* arg,

Callers

nothing calls this directly

Calls 3

NewErrorIteratorFunction · 0.85
RegisterCleanupMethod · 0.80
ValueMethod · 0.45

Tested by

no test coverage detected