| 228 | } |
| 229 | |
| 230 | void Version::AddIterators(const ReadOptions& options, |
| 231 | std::vector<Iterator*>* iters) { |
| 232 | // Merge all level zero files together since they may overlap |
| 233 | for (size_t i = 0; i < files_[0].size(); i++) { |
| 234 | iters->push_back(vset_->table_cache_->NewIterator( |
| 235 | options, files_[0][i]->number, files_[0][i]->file_size)); |
| 236 | } |
| 237 | |
| 238 | // For levels > 0, we can use a concatenating iterator that sequentially |
| 239 | // walks through the non-overlapping files in the level, opening them |
| 240 | // lazily. |
| 241 | for (int level = 1; level < config::kNumLevels; level++) { |
| 242 | if (!files_[level].empty()) { |
| 243 | iters->push_back(NewConcatenatingIterator(options, level)); |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | // Callback from TableCache::Get() |
| 249 | namespace { |
no test coverage detected