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).
11 #include "rocksdb/rocksdb_namespace.h"
13 namespace ROCKSDB_NAMESPACE
{
15 // struct ReadaheadFileInfo contains readahead information that is passed from
16 // one file to another file per level during iterations. This information helps
17 // iterators to carry forward the internal automatic prefetching readahead value
18 // to next file during sequential reads instead of starting from the scratch.
20 struct ReadaheadFileInfo
{
21 struct ReadaheadInfo
{
22 size_t readahead_size
= 0;
23 int64_t num_file_reads
= 0;
26 // Used by Data block iterators to update readahead info.
27 ReadaheadInfo data_block_readahead_info
;
29 // Used by Index block iterators to update readahead info.
30 ReadaheadInfo index_block_readahead_info
;
33 } // namespace ROCKSDB_NAMESPACE