作者: 谢瑞阳 10225101483 徐翔宇 10225101535
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

31 righe
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_