diff --git a/cache/lru_cache_test.cc b/cache/lru_cache_test.cc index 6ff2151aa..1194d1b89 100644 --- a/cache/lru_cache_test.cc +++ b/cache/lru_cache_test.cc @@ -229,7 +229,7 @@ class TestNvmCache : public NvmCache { std::unique_ptr Lookup(const Slice& key, const Cache::CreateCallback& create_cb, bool /*wait*/) override { - std::unique_ptr nvm_handle; + std::unique_ptr nvm_handle; Cache::Handle* handle = cache_->Lookup(key); num_lookups_++; if (handle) { @@ -363,8 +363,8 @@ TEST_F(LRUCacheTest, TestNvmCache) { Cache::Priority::LOW, true); ASSERT_NE(handle, nullptr); cache->Release(handle); - ASSERT_EQ(nvm_cache->num_inserts(), 2); - ASSERT_EQ(nvm_cache->num_lookups(), 1); + ASSERT_EQ(nvm_cache->num_inserts(), 2u); + ASSERT_EQ(nvm_cache->num_lookups(), 1u); } } // namespace ROCKSDB_NAMESPACE diff --git a/db/db_basic_test.cc b/db/db_basic_test.cc index 63a225252..34f27b809 100644 --- a/db/db_basic_test.cc +++ b/db/db_basic_test.cc @@ -2820,6 +2820,7 @@ class DBBasicTestMultiGet : public DBTestBase { const char* Name() const override { return "MyBlockCache"; } + using Cache::Insert; Status Insert(const Slice& key, void* value, size_t charge, void (*deleter)(const Slice& key, void* value), Handle** handle = nullptr, @@ -2828,6 +2829,7 @@ class DBBasicTestMultiGet : public DBTestBase { return target_->Insert(key, value, charge, deleter, handle, priority); } + using Cache::Lookup; Handle* Lookup(const Slice& key, Statistics* stats = nullptr) override { num_lookups_++; Handle* handle = target_->Lookup(key, stats); diff --git a/db/db_block_cache_test.cc b/db/db_block_cache_test.cc index cf6f6dfd9..a2a08abc8 100644 --- a/db/db_block_cache_test.cc +++ b/db/db_block_cache_test.cc @@ -446,6 +446,7 @@ class MockCache : public LRUCache { false /*strict_capacity_limit*/, 0.0 /*high_pri_pool_ratio*/) { } + using ShardedCache::Insert; Status Insert(const Slice& key, void* value, size_t charge, void (*deleter)(const Slice& key, void* value), Handle** handle, Priority priority) override { @@ -533,6 +534,7 @@ class LookupLiarCache : public CacheWrapper { explicit LookupLiarCache(std::shared_ptr target) : CacheWrapper(std::move(target)) {} + using Cache::Lookup; Handle* Lookup(const Slice& key, Statistics* stats) override { if (nth_lookup_not_found_ == 1) { nth_lookup_not_found_ = 0; diff --git a/include/rocksdb/cache.h b/include/rocksdb/cache.h index 933942839..b509a1a31 100644 --- a/include/rocksdb/cache.h +++ b/include/rocksdb/cache.h @@ -174,7 +174,7 @@ class Cache { // data into a buffer. The NVM cache may decide to not store it in a // contiguous buffer, in which case this callback will be called multiple // times with increasing offset - typedef rocksdb::Status (*SaveToCallback)(void* obj, size_t offset, + typedef ROCKSDB_NAMESPACE::Status (*SaveToCallback)(void* obj, size_t offset, size_t size, void* out); // DeletionCallback is a function pointer that deletes the cached @@ -191,8 +191,8 @@ class Cache { // takes in a buffer from the NVM cache and constructs an object using // it. The callback doesn't have ownership of the buffer and should // copy the contents into its own buffer. - typedef std::function + typedef std::function CreateCallback; Cache(std::shared_ptr allocator = nullptr) @@ -275,7 +275,7 @@ class Cache { CacheItemHelperCallback helper_cb, size_t charge, Handle** handle = nullptr, Priority priority = Priority::LOW) { - DeletionCallback delete_cb; + DeletionCallback delete_cb = nullptr; (*helper_cb)(nullptr, nullptr, &delete_cb); return Insert(key, value, charge, delete_cb, handle, priority); }