merger_iterator_rocks.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Tencent is pleased to support the open source community by making wwsearch
  3. * available.
  4. *
  5. * Copyright (C) 2018-present Tencent. All Rights Reserved.
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  8. * use this file except in compliance with the License. You may obtain a copy of
  9. * the License at
  10. *
  11. * https://opensource.org/licenses/Apache-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OF ANY KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations under the License.
  17. */
  18. // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
  19. // Use of this source code is governed by a BSD-style license that can be
  20. // found in the LICENSE file. See the AUTHORS file for names of contributors.
  21. #pragma once
  22. #include "iterator_rocks.h"
  23. #include "rocksdb/comparator.h"
  24. namespace rocksdb {
  25. class Comparator;
  26. }
  27. namespace wwsearch {
  28. class Iterator;
  29. // Return an iterator that provided the union of the data in
  30. // children[0,n-1]. Takes ownership of the child iterators and
  31. // will delete them when the result iterator is deleted.
  32. //
  33. // The result does no duplicate suppression. I.e., if a particular
  34. // key is present in K child iterators, it will be yielded K times.
  35. //
  36. // REQUIRES: n >= 0
  37. Iterator* NewMergingIterator(const rocksdb::Comparator* comparator,
  38. Iterator** children, int n);
  39. } // namespace wwsearch