/src/rocksdb/db/blob/prefetch_buffer_collection.cc
Line | Count | Source |
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 | | |
6 | | #include "db/blob/prefetch_buffer_collection.h" |
7 | | |
8 | | namespace ROCKSDB_NAMESPACE { |
9 | | |
10 | | FilePrefetchBuffer* PrefetchBufferCollection::GetOrCreatePrefetchBuffer( |
11 | 0 | uint64_t file_number) { |
12 | 0 | auto& prefetch_buffer = prefetch_buffers_[file_number]; |
13 | 0 | if (!prefetch_buffer) { |
14 | 0 | ReadaheadParams readahead_params; |
15 | 0 | readahead_params.initial_readahead_size = readahead_size_; |
16 | 0 | readahead_params.max_readahead_size = readahead_size_; |
17 | 0 | prefetch_buffer.reset(new FilePrefetchBuffer(readahead_params)); |
18 | 0 | } |
19 | |
|
20 | 0 | return prefetch_buffer.get(); |
21 | 0 | } |
22 | | |
23 | | } // namespace ROCKSDB_NAMESPACE |