From ecd36937705b0d51b3901b82dbf977997c0d434d Mon Sep 17 00:00:00 2001 From: anand76 Date: Tue, 30 Mar 2021 12:34:19 -0700 Subject: [PATCH] Fix formatting and a ASSERT_STATUS_CHECKED test failure --- cache/lru_cache_test.cc | 6 ++---- include/rocksdb/cache.h | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cache/lru_cache_test.cc b/cache/lru_cache_test.cc index 5d87beb23..68f6355fc 100644 --- a/cache/lru_cache_test.cc +++ b/cache/lru_cache_test.cc @@ -262,9 +262,7 @@ class TestNvmCache : public NvmCache { TestNvmCacheHandle(Cache* cache, Cache::Handle* handle, void* value, size_t size) : cache_(cache), handle_(handle), value_(value), size_(size) {} - ~TestNvmCacheHandle() { - cache_->Release(handle_); - } + ~TestNvmCacheHandle() { cache_->Release(handle_); } bool isReady() override { return true; } @@ -351,7 +349,7 @@ TEST_F(LRUCacheTest, TestNvmCache) { std::string str2 = rnd.RandomString(1020); TestItem* item2 = new TestItem(str2.data(), str2.length()); // k2 should be demoted to NVM - cache->Insert("k2", item2, helper_cb, str2.length()); + ASSERT_OK(cache->Insert("k2", item2, helper_cb, str2.length())); Cache::Handle* handle; handle = cache->Lookup("k2", helper_cb, test_item_creator, diff --git a/include/rocksdb/cache.h b/include/rocksdb/cache.h index c1f369638..38916d8eb 100644 --- a/include/rocksdb/cache.h +++ b/include/rocksdb/cache.h @@ -175,7 +175,7 @@ class Cache { // contiguous buffer, in which case this callback will be called multiple // times with increasing offset typedef ROCKSDB_NAMESPACE::Status (*SaveToCallback)(void* obj, size_t offset, - size_t size, void* out); + size_t size, void* out); // DeletionCallback is a function pointer that deletes the cached // object. The signature matches the old deleter function. @@ -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)