readahead_file_info.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. #pragma once
  6. #include <cstddef>
  7. #include <cstdint>
  8. #include "rocksdb/rocksdb_namespace.h"
  9. namespace ROCKSDB_NAMESPACE {
  10. // struct ReadaheadFileInfo contains readahead information that is passed from
  11. // one file to another file per level during iterations. This information helps
  12. // iterators to carry forward the internal automatic prefetching readahead value
  13. // to next file during sequential reads instead of starting from the scratch.
  14. struct ReadaheadFileInfo {
  15. struct ReadaheadInfo {
  16. size_t readahead_size = 0;
  17. int64_t num_file_reads = 0;
  18. };
  19. // Used by Data block iterators to update readahead info.
  20. ReadaheadInfo data_block_readahead_info;
  21. // Used by Index block iterators to update readahead info.
  22. ReadaheadInfo index_block_readahead_info;
  23. };
  24. } // namespace ROCKSDB_NAMESPACE