Fix some CircleCI failures

This commit is contained in:
anand76 2021-03-30 09:21:15 -07:00
parent 1b0a1abafa
commit 2db4e48211
4 changed files with 11 additions and 7 deletions

View File

@ -229,7 +229,7 @@ class TestNvmCache : public NvmCache {
std::unique_ptr<NvmCacheHandle> Lookup(const Slice& key,
const Cache::CreateCallback& create_cb,
bool /*wait*/) override {
std::unique_ptr<TestNvmCacheHandle> nvm_handle;
std::unique_ptr<NvmCacheHandle> 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

View File

@ -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);

View File

@ -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<Cache> 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;

View File

@ -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<rocksdb::Status(void* buf, size_t size, void** out_obj,
size_t* charge)>
typedef std::function<ROCKSDB_NAMESPACE::Status(void* buf, size_t size,
void** out_obj, size_t* charge)>
CreateCallback;
Cache(std::shared_ptr<MemoryAllocator> 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);
}