1*9507f98cSAndroid Build Coastguard Worker // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2*9507f98cSAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be 3*9507f98cSAndroid Build Coastguard Worker // found in the LICENSE file. See the AUTHORS file for names of contributors. 4*9507f98cSAndroid Build Coastguard Worker 5*9507f98cSAndroid Build Coastguard Worker #ifndef STORAGE_LEVELDB_TABLE_MERGER_H_ 6*9507f98cSAndroid Build Coastguard Worker #define STORAGE_LEVELDB_TABLE_MERGER_H_ 7*9507f98cSAndroid Build Coastguard Worker 8*9507f98cSAndroid Build Coastguard Worker namespace leveldb { 9*9507f98cSAndroid Build Coastguard Worker 10*9507f98cSAndroid Build Coastguard Worker class Comparator; 11*9507f98cSAndroid Build Coastguard Worker class Iterator; 12*9507f98cSAndroid Build Coastguard Worker 13*9507f98cSAndroid Build Coastguard Worker // Return an iterator that provided the union of the data in 14*9507f98cSAndroid Build Coastguard Worker // children[0,n-1]. Takes ownership of the child iterators and 15*9507f98cSAndroid Build Coastguard Worker // will delete them when the result iterator is deleted. 16*9507f98cSAndroid Build Coastguard Worker // 17*9507f98cSAndroid Build Coastguard Worker // The result does no duplicate suppression. I.e., if a particular 18*9507f98cSAndroid Build Coastguard Worker // key is present in K child iterators, it will be yielded K times. 19*9507f98cSAndroid Build Coastguard Worker // 20*9507f98cSAndroid Build Coastguard Worker // REQUIRES: n >= 0 21*9507f98cSAndroid Build Coastguard Worker Iterator* NewMergingIterator(const Comparator* comparator, Iterator** children, 22*9507f98cSAndroid Build Coastguard Worker int n); 23*9507f98cSAndroid Build Coastguard Worker 24*9507f98cSAndroid Build Coastguard Worker } // namespace leveldb 25*9507f98cSAndroid Build Coastguard Worker 26*9507f98cSAndroid Build Coastguard Worker #endif // STORAGE_LEVELDB_TABLE_MERGER_H_ 27