小组成员: 曹可心-10223903406 朴祉燕-10224602413
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

31 行
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)(void* arg, const ReadOptions& options,
  21. const Slice& index_value),
  22. void* arg, const ReadOptions& options);
  23. } // namespace leveldb
  24. #endif // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_