1179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org// Use of this source code is governed by a BSD-style license that can be
3179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org// found in the LICENSE file. See the AUTHORS file for names of contributors.
4179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org
5179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org#ifndef STORAGE_LEVELDB_TABLE_MERGER_H_
6179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org#define STORAGE_LEVELDB_TABLE_MERGER_H_
7179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org
8179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.orgnamespace leveldb {
9179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org
10179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.orgclass Comparator;
11179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.orgclass Iterator;
12179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org
13179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org// Return an iterator that provided the union of the data in
14179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org// children[0,n-1].  Takes ownership of the child iterators and
15179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org// will delete them when the result iterator is deleted.
16179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org//
17179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org// The result does no duplicate suppression.  I.e., if a particular
18179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org// key is present in K child iterators, it will be yielded K times.
19179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org//
20179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org// REQUIRES: n >= 0
21179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.orgextern Iterator* NewMergingIterator(
22179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org    const Comparator* comparator, Iterator** children, int n);
23179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org
2445b9940be332834440bd5299419f396e38085ebehans@chromium.org}  // namespace leveldb
25179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org
26179be588c25dccaa963df9c9c104fc6229435483jorlow@chromium.org#endif  // STORAGE_LEVELDB_TABLE_MERGER_H_
27