| 214 | } |
| 215 | |
| 216 | Status Table::InternalGet(const ReadOptions& options, const Slice& k, void* arg, |
| 217 | void (*handle_result)(void*, const Slice&, |
| 218 | const Slice&)) { |
| 219 | Status s; |
| 220 | Iterator* iiter = rep_->index_block->NewIterator(rep_->options.comparator); |
| 221 | iiter->Seek(k); |
| 222 | if (iiter->Valid()) { |
| 223 | Slice handle_value = iiter->value(); |
| 224 | FilterBlockReader* filter = rep_->filter; |
| 225 | BlockHandle handle; |
| 226 | if (filter != nullptr && handle.DecodeFrom(&handle_value).ok() && |
| 227 | !filter->KeyMayMatch(handle.offset(), k)) { |
| 228 | // Not found |
| 229 | } else { |
| 230 | Iterator* block_iter = BlockReader(this, options, iiter->value()); |
| 231 | block_iter->Seek(k); |
| 232 | if (block_iter->Valid()) { |
| 233 | (*handle_result)(arg, block_iter->key(), block_iter->value()); |
| 234 | } |
| 235 | s = block_iter->status(); |
| 236 | delete block_iter; |
| 237 | } |
| 238 | } |
| 239 | if (s.ok()) { |
| 240 | s = iiter->status(); |
| 241 | } |
| 242 | delete iiter; |
| 243 | return s; |
| 244 | } |
| 245 | |
| 246 | uint64_t Table::ApproximateOffsetOf(const Slice& key) const { |
| 247 | Iterator* index_iter = |
no test coverage detected