/src/rocksdb/table/persistent_cache_options.h
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 | | #pragma once |
6 | | |
7 | | #include <string> |
8 | | |
9 | | #include "cache/cache_key.h" |
10 | | #include "monitoring/statistics_impl.h" |
11 | | #include "rocksdb/persistent_cache.h" |
12 | | |
13 | | namespace ROCKSDB_NAMESPACE { |
14 | | |
15 | | // PersistentCacheOptions |
16 | | // |
17 | | // This describe the caching behavior for page cache |
18 | | // This is used to pass the context for caching and the cache handle |
19 | | struct PersistentCacheOptions { |
20 | 52.6k | PersistentCacheOptions() {} |
21 | | explicit PersistentCacheOptions( |
22 | | const std::shared_ptr<PersistentCache>& _persistent_cache, |
23 | | const OffsetableCacheKey& _base_cache_key, Statistics* const _statistics) |
24 | | : persistent_cache(_persistent_cache), |
25 | | base_cache_key(_base_cache_key), |
26 | 26.2k | statistics(_statistics) {} |
27 | | std::shared_ptr<PersistentCache> persistent_cache; |
28 | | OffsetableCacheKey base_cache_key; |
29 | | Statistics* statistics = nullptr; |
30 | | |
31 | | static const PersistentCacheOptions kEmpty; |
32 | | }; |
33 | | |
34 | | } // namespace ROCKSDB_NAMESPACE |