]> git.proxmox.com Git - ceph.git/blame - ceph/src/rocksdb/table/two_level_iterator.h
bump version to 15.2.11-pve1
[ceph.git] / ceph / src / rocksdb / table / two_level_iterator.h
CommitLineData
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
15namespace rocksdb {
16
17struct ReadOptions;
18class InternalKeyComparator;
7c673cae 19
11fdf7f2 20// TwoLevelIteratorState expects iterators are not created using the arena
7c673cae 21struct TwoLevelIteratorState {
11fdf7f2 22 TwoLevelIteratorState() {}
7c673cae
FG
23
24 virtual ~TwoLevelIteratorState() {}
11fdf7f2
TL
25 virtual InternalIteratorBase<BlockHandle>* NewSecondaryIterator(
26 const BlockHandle& handle) = 0;
7c673cae
FG
27};
28
29
30// Return a new two level iterator. A two-level iterator contains an
31// index iterator whose values point to a sequence of blocks where
32// each block is itself a sequence of key,value pairs. The returned
33// two-level iterator yields the concatenation of all key/value pairs
34// in the sequence of blocks. Takes ownership of "index_iter" and
35// will delete it when no longer needed.
36//
37// Uses a supplied function to convert an index_iter value into
38// an iterator over the contents of the corresponding block.
11fdf7f2
TL
39// Note: this function expects first_level_iter was not created using the arena
40extern InternalIteratorBase<BlockHandle>* NewTwoLevelIterator(
41 TwoLevelIteratorState* state,
42 InternalIteratorBase<BlockHandle>* first_level_iter);
7c673cae
FG
43
44} // namespace rocksdb