Fix comments and an ASSERT_STATUS_CHECKED bug
This commit is contained in:
parent
8015fc9871
commit
b42d4a8ad4
2
cache/lru_cache_test.cc
vendored
2
cache/lru_cache_test.cc
vendored
@ -345,7 +345,7 @@ TEST_F(LRUCacheTest, TestTieredCache) {
|
|||||||
Random rnd(301);
|
Random rnd(301);
|
||||||
std::string str1 = rnd.RandomString(1020);
|
std::string str1 = rnd.RandomString(1020);
|
||||||
TestItem* item1 = new TestItem(str1.data(), str1.length());
|
TestItem* item1 = new TestItem(str1.data(), str1.length());
|
||||||
cache->Insert("k1", item1, helper_cb, str1.length());
|
ASSERT_OK(cache->Insert("k1", item1, helper_cb, str1.length()));
|
||||||
std::string str2 = rnd.RandomString(1020);
|
std::string str2 = rnd.RandomString(1020);
|
||||||
TestItem* item2 = new TestItem(str2.data(), str2.length());
|
TestItem* item2 = new TestItem(str2.data(), str2.length());
|
||||||
// k2 should be demoted to NVM
|
// k2 should be demoted to NVM
|
||||||
|
@ -48,15 +48,16 @@ class TieredCache {
|
|||||||
|
|
||||||
virtual std::string Name() = 0;
|
virtual std::string Name() = 0;
|
||||||
|
|
||||||
// Insert the given value into the NVM cache. The value is not written
|
// Insert the given value into this tier. The value is not written
|
||||||
// directly. Rather, the SaveToCallback provided by helper_cb will be
|
// directly. Rather, the SaveToCallback provided by helper_cb will be
|
||||||
// used to extract the persistable data in value, which will be written
|
// used to extract the persistable data in value, which will be written
|
||||||
// to this tier. The implementation may or may not write it to NVM depending
|
// to this tier. The implementation may or may not write it to cache
|
||||||
// on the admission control policy, even if the return status is success.
|
// depending on the admission control policy, even if the return status is
|
||||||
|
// success.
|
||||||
virtual Status Insert(const Slice& key, void* value,
|
virtual Status Insert(const Slice& key, void* value,
|
||||||
Cache::CacheItemHelperCallback helper_cb) = 0;
|
Cache::CacheItemHelperCallback helper_cb) = 0;
|
||||||
|
|
||||||
// Lookup the data for the given key in the NVM cache. The create_cb
|
// Lookup the data for the given key in this tier. The create_cb
|
||||||
// will be used to create the object. The handle returned may not be
|
// will be used to create the object. The handle returned may not be
|
||||||
// ready yet, unless wait=true, in which case Lookup() will block until
|
// ready yet, unless wait=true, in which case Lookup() will block until
|
||||||
// the handle is ready
|
// the handle is ready
|
||||||
|
Loading…
x
Reference in New Issue
Block a user