2013-10-16 23:59:46 +02:00
|
|
|
// Copyright (c) 2013, Facebook, Inc. All rights reserved.
|
|
|
|
// This source code is licensed under the BSD-style license found in the
|
|
|
|
// LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
// of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
//
|
2011-03-18 23:37:00 +01:00
|
|
|
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
|
|
|
|
2013-10-05 07:32:05 +02:00
|
|
|
#pragma once
|
2013-08-23 17:38:13 +02:00
|
|
|
#include "rocksdb/iterator.h"
|
|
|
|
#include "rocksdb/env.h"
|
2011-03-18 23:37:00 +01:00
|
|
|
|
2013-10-04 06:49:15 +02:00
|
|
|
namespace rocksdb {
|
2011-03-18 23:37:00 +01:00
|
|
|
|
|
|
|
struct ReadOptions;
|
2014-01-27 22:53:22 +01:00
|
|
|
class InternalKeyComparator;
|
2011-03-18 23:37:00 +01:00
|
|
|
|
|
|
|
// Return a new two level iterator. A two-level iterator contains an
|
|
|
|
// index iterator whose values point to a sequence of blocks where
|
|
|
|
// each block is itself a sequence of key,value pairs. The returned
|
|
|
|
// two-level iterator yields the concatenation of all key/value pairs
|
|
|
|
// in the sequence of blocks. Takes ownership of "index_iter" and
|
|
|
|
// will delete it when no longer needed.
|
|
|
|
//
|
|
|
|
// Uses a supplied function to convert an index_iter value into
|
|
|
|
// an iterator over the contents of the corresponding block.
|
|
|
|
extern Iterator* NewTwoLevelIterator(
|
|
|
|
Iterator* index_iter,
|
|
|
|
Iterator* (*block_function)(
|
2014-01-27 22:53:22 +01:00
|
|
|
void* arg, const ReadOptions& options, const EnvOptions& soptions,
|
|
|
|
const InternalKeyComparator& internal_comparator,
|
|
|
|
const Slice& index_value, bool for_compaction),
|
|
|
|
void* arg, const ReadOptions& options, const EnvOptions& soptions,
|
|
|
|
const InternalKeyComparator& internal_comparator,
|
2013-05-18 00:53:01 +02:00
|
|
|
bool for_compaction = false);
|
2011-03-18 23:37:00 +01:00
|
|
|
|
2013-10-04 06:49:15 +02:00
|
|
|
} // namespace rocksdb
|