]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/db/blob/blob_file_cache.h
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).
10 #include "cache/cache_helpers.h"
11 #include "rocksdb/rocksdb_namespace.h"
12 #include "util/mutexlock.h"
14 namespace ROCKSDB_NAMESPACE
{
17 struct ImmutableCFOptions
;
26 BlobFileCache(Cache
* cache
, const ImmutableCFOptions
* immutable_cf_options
,
27 const FileOptions
* file_options
, uint32_t column_family_id
,
28 HistogramImpl
* blob_file_read_hist
);
30 BlobFileCache(const BlobFileCache
&) = delete;
31 BlobFileCache
& operator=(const BlobFileCache
&) = delete;
33 Status
GetBlobFileReader(uint64_t blob_file_number
,
34 CacheHandleGuard
<BlobFileReader
>* blob_file_reader
);
38 // Note: mutex_ below is used to guard against multiple threads racing to open
40 Striped
<port::Mutex
, Slice
> mutex_
;
41 const ImmutableCFOptions
* immutable_cf_options_
;
42 const FileOptions
* file_options_
;
43 uint32_t column_family_id_
;
44 HistogramImpl
* blob_file_read_hist_
;
46 static constexpr size_t kNumberOfMutexStripes
= 1 << 7;
49 } // namespace ROCKSDB_NAMESPACE