1 // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. See the AUTHORS file for names of contributors.
5 #ifndef STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
6 #define STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
8 #include "leveldb/iterator.h"
14 // Return a new two level iterator. A two-level iterator contains an
15 // index iterator whose values point to a sequence of blocks where
16 // each block is itself a sequence of key,value pairs. The returned
17 // two-level iterator yields the concatenation of all key/value pairs
18 // in the sequence of blocks. Takes ownership of "index_iter" and
19 // will delete it when no longer needed.
21 // Uses a supplied function to convert an index_iter value into
22 // an iterator over the contents of the corresponding block.
23 extern Iterator* NewTwoLevelIterator(
25 Iterator* (*block_function)(
27 const ReadOptions& options,
28 const Slice& index_value),
30 const ReadOptions& options);
32 } // namespace leveldb
34 #endif // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_