]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. |
11fdf7f2 TL |
2 | // This source code is licensed under both the GPLv2 (found in the |
3 | // COPYING file in the root directory) and Apache 2.0 License | |
4 | // (found in the LICENSE.Apache file in the root directory). | |
7c673cae FG |
5 | // |
6 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. | |
7 | // Use of this source code is governed by a BSD-style license that can be | |
8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. | |
9 | ||
10 | #pragma once | |
11 | #include "rocksdb/iterator.h" | |
12 | #include "rocksdb/env.h" | |
13 | #include "table/iterator_wrapper.h" | |
14 | ||
f67539c2 | 15 | namespace ROCKSDB_NAMESPACE { |
7c673cae FG |
16 | |
17 | struct ReadOptions; | |
18 | class InternalKeyComparator; | |
7c673cae | 19 | |
11fdf7f2 | 20 | // TwoLevelIteratorState expects iterators are not created using the arena |
7c673cae | 21 | struct TwoLevelIteratorState { |
11fdf7f2 | 22 | TwoLevelIteratorState() {} |
7c673cae FG |
23 | |
24 | virtual ~TwoLevelIteratorState() {} | |
f67539c2 | 25 | virtual InternalIteratorBase<IndexValue>* NewSecondaryIterator( |
11fdf7f2 | 26 | const BlockHandle& handle) = 0; |
7c673cae FG |
27 | }; |
28 | ||
7c673cae FG |
29 | // Return a new two level iterator. A two-level iterator contains an |
30 | // index iterator whose values point to a sequence of blocks where | |
31 | // each block is itself a sequence of key,value pairs. The returned | |
32 | // two-level iterator yields the concatenation of all key/value pairs | |
33 | // in the sequence of blocks. Takes ownership of "index_iter" and | |
34 | // will delete it when no longer needed. | |
35 | // | |
36 | // Uses a supplied function to convert an index_iter value into | |
37 | // an iterator over the contents of the corresponding block. | |
11fdf7f2 | 38 | // Note: this function expects first_level_iter was not created using the arena |
f67539c2 | 39 | extern InternalIteratorBase<IndexValue>* NewTwoLevelIterator( |
11fdf7f2 | 40 | TwoLevelIteratorState* state, |
f67539c2 | 41 | InternalIteratorBase<IndexValue>* first_level_iter); |
7c673cae | 42 | |
f67539c2 | 43 | } // namespace ROCKSDB_NAMESPACE |