作者: 韩晨旭 10225101440 李畅 10225102463
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

34 Zeilen
1.2 KiB

  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.
  4. #ifndef STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
  5. #define STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
  6. #include "leveldb/iterator.h"
  7. namespace leveldb {
  8. struct ReadOptions;
  9. // Return a new two level iterator. A two-level iterator contains an
  10. // index iterator whose values point to a sequence of blocks where
  11. // each block is itself a sequence of key,value pairs. The returned
  12. // two-level iterator yields the concatenation of all key/value pairs
  13. // in the sequence of blocks. Takes ownership of "index_iter" and
  14. // will delete it when no longer needed.
  15. //
  16. // Uses a supplied function to convert an index_iter value into
  17. // an iterator over the contents of the corresponding block.
  18. Iterator* NewTwoLevelIterator(
  19. Iterator* index_iter,
  20. Iterator* (*block_function)(
  21. void* arg,
  22. const ReadOptions& options,
  23. const Slice& index_value),
  24. void* arg,
  25. const ReadOptions& options);
  26. } // namespace leveldb
  27. #endif // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_