]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/utilities/persistent_cache/block_cache_tier.cc
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / utilities / persistent_cache / block_cache_tier.cc
index 658737571719311e4fc0ef1ced2ac0596e5172eb..8ad9bb1b1662f00b5f1f5fa79569173a62758b26 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "utilities/persistent_cache/block_cache_tier.h"
 
-#include <regex>
 #include <utility>
 #include <vector>
 
@@ -133,7 +132,7 @@ Status BlockCacheTier::Close() {
   return Status::OK();
 }
 
-template<class T>
+template <class T>
 void Add(std::map<std::string, double>* stats, const std::string& key,
          const T& t) {
   stats->insert({key, static_cast<double>(t)});
@@ -149,8 +148,7 @@ PersistentCache::StatsType BlockCacheTier::Stats() {
       stats_.bytes_read_.Average());
   Add(&stats, "persistentcache.blockcachetier.insert_dropped",
       stats_.insert_dropped_);
-  Add(&stats, "persistentcache.blockcachetier.cache_hits",
-      stats_.cache_hits_);
+  Add(&stats, "persistentcache.blockcachetier.cache_hits", stats_.cache_hits_);
   Add(&stats, "persistentcache.blockcachetier.cache_misses",
       stats_.cache_misses_);
   Add(&stats, "persistentcache.blockcachetier.cache_errors",
@@ -222,7 +220,7 @@ Status BlockCacheTier::InsertImpl(const Slice& key, const Slice& data) {
   assert(data.size());
   assert(cache_file_);
 
-  StopWatchNano timer(opt_.env, /*auto_start=*/ true);
+  StopWatchNano timer(opt_.clock, /*auto_start=*/true);
 
   WriteLock _(&lock_);
 
@@ -265,7 +263,7 @@ Status BlockCacheTier::InsertImpl(const Slice& key, const Slice& data) {
 
 Status BlockCacheTier::Lookup(const Slice& key, std::unique_ptr<char[]>* val,
                               size_t* size) {
-  StopWatchNano timer(opt_.env, /*auto_start=*/ true);
+  StopWatchNano timer(opt_.clock, /*auto_start=*/true);
 
   LBA lba;
   bool status;
@@ -327,10 +325,9 @@ Status BlockCacheTier::NewCacheFile() {
   TEST_SYNC_POINT_CALLBACK("BlockCacheTier::NewCacheFile:DeleteDir",
                            (void*)(GetCachePath().c_str()));
 
-  std::unique_ptr<WriteableCacheFile> f(
-    new WriteableCacheFile(opt_.env, &buffer_allocator_, &writer_,
-                           GetCachePath(), writer_cache_id_,
-                           opt_.cache_file_size, opt_.log));
+  std::unique_ptr<WriteableCacheFile> f(new WriteableCacheFile(
+      opt_.env, &buffer_allocator_, &writer_, GetCachePath(), writer_cache_id_,
+      opt_.cache_file_size, opt_.log));
 
   bool status = f->Create(opt_.enable_direct_writes, opt_.enable_direct_reads);
   if (!status) {