]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/table/persistent_cache_helper.h
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same directory.
9 #include "monitoring/statistics.h"
10 #include "table/format.h"
11 #include "table/persistent_cache_options.h"
17 // PersistentCacheHelper
19 // Encapsulates some of the helper logic for read and writing from the cache
20 class PersistentCacheHelper
{
22 // insert block into raw page cache
23 static void InsertRawPage(const PersistentCacheOptions
& cache_options
,
24 const BlockHandle
& handle
, const char* data
,
27 // insert block into uncompressed cache
28 static void InsertUncompressedPage(
29 const PersistentCacheOptions
& cache_options
, const BlockHandle
& handle
,
30 const BlockContents
& contents
);
32 // lookup block from raw page cacge
33 static Status
LookupRawPage(const PersistentCacheOptions
& cache_options
,
34 const BlockHandle
& handle
,
35 std::unique_ptr
<char[]>* raw_data
,
36 const size_t raw_data_size
);
38 // lookup block from uncompressed cache
39 static Status
LookupUncompressedPage(
40 const PersistentCacheOptions
& cache_options
, const BlockHandle
& handle
,
41 BlockContents
* contents
);
44 } // namespace rocksdb