|
7 | 7 |
|
8 | 8 | #include "rocksdb/sst_file_reader.h"
|
9 | 9 |
|
| 10 | +#include "db/arena_wrapped_db_iter.h" |
10 | 11 | #include "db/db_iter.h"
|
11 | 12 | #include "db/dbformat.h"
|
12 | 13 | #include "env/composite_env_wrapper.h"
|
@@ -62,18 +63,23 @@ Status SstFileReader::Open(const std::string& file_path) {
|
62 | 63 | return s;
|
63 | 64 | }
|
64 | 65 |
|
65 |
| -Iterator* SstFileReader::NewIterator(const ReadOptions& options) { |
| 66 | +Iterator* SstFileReader::NewIterator(const ReadOptions& roptions) { |
66 | 67 | auto r = rep_.get();
|
67 |
| - auto sequence = options.snapshot != nullptr |
68 |
| - ? options.snapshot->GetSequenceNumber() |
| 68 | + auto sequence = roptions.snapshot != nullptr |
| 69 | + ? roptions.snapshot->GetSequenceNumber() |
69 | 70 | : kMaxSequenceNumber;
|
| 71 | + ArenaWrappedDBIter* res = new ArenaWrappedDBIter(); |
| 72 | + res->Init(r->options.env, roptions, r->ioptions, r->moptions, sequence, |
| 73 | + r->moptions.max_sequential_skip_in_iterations, |
| 74 | + 0 /* version_number */, nullptr /* read_callback */, |
| 75 | + nullptr /* db_impl */, nullptr /* cfd */, false /* allow_blob */, |
| 76 | + false /* allow_refresh */); |
70 | 77 | auto internal_iter = r->table_reader->NewIterator(
|
71 |
| - options, r->moptions.prefix_extractor.get(), /*arena=*/nullptr, |
72 |
| - /*skip_filters=*/false, TableReaderCaller::kSSTFileReader); |
73 |
| - return NewDBIterator(r->options.env, options, r->ioptions, r->moptions, |
74 |
| - r->ioptions.user_comparator, internal_iter, sequence, |
75 |
| - r->moptions.max_sequential_skip_in_iterations, |
76 |
| - nullptr /* read_callback */); |
| 78 | + res->GetReadOptions(), r->moptions.prefix_extractor.get(), |
| 79 | + res->GetArena(), false /* skip_filters */, |
| 80 | + TableReaderCaller::kSSTFileReader); |
| 81 | + res->SetIterUnderDBIter(internal_iter); |
| 82 | + return res; |
77 | 83 | }
|
78 | 84 |
|
79 | 85 | std::shared_ptr<const TableProperties> SstFileReader::GetTableProperties()
|
|
0 commit comments