diff --git a/cache/lru_cache.cc b/cache/lru_cache.cc index 8d062f2b57c..2a4c0f77a08 100644 --- a/cache/lru_cache.cc +++ b/cache/lru_cache.cc @@ -158,7 +158,7 @@ void LRUCacheShard::TEST_GetLRUList(LRUHandle** lru, LRUHandle** lru_low_pri) { } size_t LRUCacheShard::TEST_GetLRUSize() { - LRUHandle *lru_handle = lru_.next; + LRUHandle* lru_handle = lru_.next; size_t lru_size = 0; while (lru_handle != &lru_) { lru_size++; diff --git a/db/db_test.cc b/db/db_test.cc index 24423636542..e9840faa042 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -5332,20 +5332,23 @@ TEST_F(DBTest, PinnableSliceAndRowCache) { ASSERT_OK(Flush()); ASSERT_EQ(Get("foo"), "bar"); - ASSERT_EQ(reinterpret_cast(options.row_cache.get())-> - TEST_GetLRUSize(), 1); + ASSERT_EQ( + reinterpret_cast(options.row_cache.get())->TEST_GetLRUSize(), + 1); { PinnableSlice pin_slice; ASSERT_EQ(Get("foo", &pin_slice), Status::OK()); ASSERT_EQ(pin_slice.ToString(), "bar"); // Entry is already in cache, lookup will remove the element from lru - ASSERT_EQ(reinterpret_cast(options.row_cache.get())-> - TEST_GetLRUSize(), 0); + ASSERT_EQ( + reinterpret_cast(options.row_cache.get())->TEST_GetLRUSize(), + 0); } // After PinnableSlice destruction element is added back in LRU - ASSERT_EQ(reinterpret_cast(options.row_cache.get())-> - TEST_GetLRUSize(), 1); + ASSERT_EQ( + reinterpret_cast(options.row_cache.get())->TEST_GetLRUSize(), + 1); } #endif // ROCKSDB_LITE diff --git a/db/table_cache.cc b/db/table_cache.cc index 14ad04552b5..4dc56935fbc 100644 --- a/db/table_cache.cc +++ b/db/table_cache.cc @@ -335,11 +335,11 @@ Status TableCache::Get(const ReadOptions& options, if (auto row_handle = ioptions_.row_cache->Lookup(row_cache_key.GetUserKey())) { - // Cleanable routine to release the cache entry Cleanable value_pinner; - auto release_cache_entry_func = [] (void* cache_to_clean, void* cache_handle){ - ((Cache*)cache_to_clean)->Release((Cache::Handle*) cache_handle); + auto release_cache_entry_func = [](void* cache_to_clean, + void* cache_handle) { + ((Cache*)cache_to_clean)->Release((Cache::Handle*)cache_handle); }; auto found_row_cache_entry = static_cast( ioptions_.row_cache->Value(row_handle)); @@ -352,7 +352,7 @@ Status TableCache::Get(const ReadOptions& options, // get_context.pinnable_slice_. Cache entry is released when // get_context.pinnable_slice_ is reset. value_pinner.RegisterCleanup(release_cache_entry_func, - ioptions_.row_cache.get(), row_handle); + ioptions_.row_cache.get(), row_handle); replayGetContextLog(*found_row_cache_entry, user_key, get_context, &value_pinner); RecordTick(ioptions_.statistics, ROW_CACHE_HIT); diff --git a/table/get_context.cc b/table/get_context.cc index db3f70ba8dc..0d688fe4609 100644 --- a/table/get_context.cc +++ b/table/get_context.cc @@ -194,7 +194,8 @@ void replayGetContextLog(const Slice& replay_log, const Slice& user_key, // Since SequenceNumber is not stored and unknown, we will use // kMaxSequenceNumber. get_context->SaveValue( - ParsedInternalKey(user_key, kMaxSequenceNumber, type), value, value_pinner); + ParsedInternalKey(user_key, kMaxSequenceNumber, type), value, + value_pinner); } #else // ROCKSDB_LITE assert(false); diff --git a/table/get_context.h b/table/get_context.h index 0fddecec3f6..ac50680b645 100644 --- a/table/get_context.h +++ b/table/get_context.h @@ -87,6 +87,6 @@ class GetContext { void replayGetContextLog(const Slice& replay_log, const Slice& user_key, GetContext* get_context, - Cleanable *value_pinner = nullptr); + Cleanable* value_pinner = nullptr); } // namespace rocksdb