| 76 | } |
| 77 | |
| 78 | Iterator* 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 | |
| 100 | Status TableCache::Get(const ReadOptions& options, uint64_t file_number, |
| 101 | uint64_t file_size, const Slice& k, void* arg, |
nothing calls this directly
no test coverage detected