Fix some CircleCI failures
This commit is contained in:
parent
1b0a1abafa
commit
2db4e48211
6
cache/lru_cache_test.cc
vendored
6
cache/lru_cache_test.cc
vendored
@ -229,7 +229,7 @@ class TestNvmCache : public NvmCache {
|
|||||||
std::unique_ptr<NvmCacheHandle> Lookup(const Slice& key,
|
std::unique_ptr<NvmCacheHandle> Lookup(const Slice& key,
|
||||||
const Cache::CreateCallback& create_cb,
|
const Cache::CreateCallback& create_cb,
|
||||||
bool /*wait*/) override {
|
bool /*wait*/) override {
|
||||||
std::unique_ptr<TestNvmCacheHandle> nvm_handle;
|
std::unique_ptr<NvmCacheHandle> nvm_handle;
|
||||||
Cache::Handle* handle = cache_->Lookup(key);
|
Cache::Handle* handle = cache_->Lookup(key);
|
||||||
num_lookups_++;
|
num_lookups_++;
|
||||||
if (handle) {
|
if (handle) {
|
||||||
@ -363,8 +363,8 @@ TEST_F(LRUCacheTest, TestNvmCache) {
|
|||||||
Cache::Priority::LOW, true);
|
Cache::Priority::LOW, true);
|
||||||
ASSERT_NE(handle, nullptr);
|
ASSERT_NE(handle, nullptr);
|
||||||
cache->Release(handle);
|
cache->Release(handle);
|
||||||
ASSERT_EQ(nvm_cache->num_inserts(), 2);
|
ASSERT_EQ(nvm_cache->num_inserts(), 2u);
|
||||||
ASSERT_EQ(nvm_cache->num_lookups(), 1);
|
ASSERT_EQ(nvm_cache->num_lookups(), 1u);
|
||||||
}
|
}
|
||||||
} // namespace ROCKSDB_NAMESPACE
|
} // namespace ROCKSDB_NAMESPACE
|
||||||
|
|
||||||
|
@ -2820,6 +2820,7 @@ class DBBasicTestMultiGet : public DBTestBase {
|
|||||||
|
|
||||||
const char* Name() const override { return "MyBlockCache"; }
|
const char* Name() const override { return "MyBlockCache"; }
|
||||||
|
|
||||||
|
using Cache::Insert;
|
||||||
Status Insert(const Slice& key, void* value, size_t charge,
|
Status Insert(const Slice& key, void* value, size_t charge,
|
||||||
void (*deleter)(const Slice& key, void* value),
|
void (*deleter)(const Slice& key, void* value),
|
||||||
Handle** handle = nullptr,
|
Handle** handle = nullptr,
|
||||||
@ -2828,6 +2829,7 @@ class DBBasicTestMultiGet : public DBTestBase {
|
|||||||
return target_->Insert(key, value, charge, deleter, handle, priority);
|
return target_->Insert(key, value, charge, deleter, handle, priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using Cache::Lookup;
|
||||||
Handle* Lookup(const Slice& key, Statistics* stats = nullptr) override {
|
Handle* Lookup(const Slice& key, Statistics* stats = nullptr) override {
|
||||||
num_lookups_++;
|
num_lookups_++;
|
||||||
Handle* handle = target_->Lookup(key, stats);
|
Handle* handle = target_->Lookup(key, stats);
|
||||||
|
@ -446,6 +446,7 @@ class MockCache : public LRUCache {
|
|||||||
false /*strict_capacity_limit*/, 0.0 /*high_pri_pool_ratio*/) {
|
false /*strict_capacity_limit*/, 0.0 /*high_pri_pool_ratio*/) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using ShardedCache::Insert;
|
||||||
Status Insert(const Slice& key, void* value, size_t charge,
|
Status Insert(const Slice& key, void* value, size_t charge,
|
||||||
void (*deleter)(const Slice& key, void* value), Handle** handle,
|
void (*deleter)(const Slice& key, void* value), Handle** handle,
|
||||||
Priority priority) override {
|
Priority priority) override {
|
||||||
@ -533,6 +534,7 @@ class LookupLiarCache : public CacheWrapper {
|
|||||||
explicit LookupLiarCache(std::shared_ptr<Cache> target)
|
explicit LookupLiarCache(std::shared_ptr<Cache> target)
|
||||||
: CacheWrapper(std::move(target)) {}
|
: CacheWrapper(std::move(target)) {}
|
||||||
|
|
||||||
|
using Cache::Lookup;
|
||||||
Handle* Lookup(const Slice& key, Statistics* stats) override {
|
Handle* Lookup(const Slice& key, Statistics* stats) override {
|
||||||
if (nth_lookup_not_found_ == 1) {
|
if (nth_lookup_not_found_ == 1) {
|
||||||
nth_lookup_not_found_ = 0;
|
nth_lookup_not_found_ = 0;
|
||||||
|
@ -174,7 +174,7 @@ class Cache {
|
|||||||
// data into a buffer. The NVM cache may decide to not store it in a
|
// 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
|
// contiguous buffer, in which case this callback will be called multiple
|
||||||
// times with increasing offset
|
// 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);
|
size_t size, void* out);
|
||||||
|
|
||||||
// DeletionCallback is a function pointer that deletes the cached
|
// 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
|
// 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
|
// it. The callback doesn't have ownership of the buffer and should
|
||||||
// copy the contents into its own buffer.
|
// copy the contents into its own buffer.
|
||||||
typedef std::function<rocksdb::Status(void* buf, size_t size, void** out_obj,
|
typedef std::function<ROCKSDB_NAMESPACE::Status(void* buf, size_t size,
|
||||||
size_t* charge)>
|
void** out_obj, size_t* charge)>
|
||||||
CreateCallback;
|
CreateCallback;
|
||||||
|
|
||||||
Cache(std::shared_ptr<MemoryAllocator> allocator = nullptr)
|
Cache(std::shared_ptr<MemoryAllocator> allocator = nullptr)
|
||||||
@ -275,7 +275,7 @@ class Cache {
|
|||||||
CacheItemHelperCallback helper_cb, size_t charge,
|
CacheItemHelperCallback helper_cb, size_t charge,
|
||||||
Handle** handle = nullptr,
|
Handle** handle = nullptr,
|
||||||
Priority priority = Priority::LOW) {
|
Priority priority = Priority::LOW) {
|
||||||
DeletionCallback delete_cb;
|
DeletionCallback delete_cb = nullptr;
|
||||||
(*helper_cb)(nullptr, nullptr, &delete_cb);
|
(*helper_cb)(nullptr, nullptr, &delete_cb);
|
||||||
return Insert(key, value, charge, delete_cb, handle, priority);
|
return Insert(key, value, charge, delete_cb, handle, priority);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user