Skip to content

Commit f1e0512

Browse files
HelenHelen
Helen
authored and
Helen
committed
Remove some debugging code
1 parent 4f4fd8a commit f1e0512

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cachelib/allocator/CacheTraits.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct TinyLFUCacheTrait {
5656
};
5757

5858
struct SieveCacheTrait {
59-
using MMType = MMTinyLFU;
59+
using MMType = MMSieve;
6060
using AccessType = ChainedHashTable;
6161
using AccessTypeLocks = SharedMutexBuckets;
6262
};

cachelib/allocator/MMSieve.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ bool MMSieve::Container<T, HookPtr>::recordAccess(T& node,
343343
(mode == AccessMode::kRead && !config_.updateOnRead)) {
344344
return false;
345345
}
346-
const auto curr = static_cast<Time>(util::getCurrentTimeSec());
347346
// check if the node is still being memory managed
348347
if (node.isInMMContainer() && !isAccessed(node)){
349348
markAccessed(node);
@@ -364,6 +363,9 @@ cachelib::EvictionAgeStat
364363
MMSieve::Container<T, HookPtr>::getEvictionAgeStatLocked(
365364
uint64_t projectedLength) const noexcept {
366365
EvictionAgeStat stat{};
366+
/*Eviction Age is used by LruTailAge Rebalance Strategy,
367+
* but Sieve doesn't have a defined tail age.*/
368+
367369
const auto currTime = static_cast<Time>(util::getCurrentTimeSec());
368370

369371
const T* node = queue_.getTail();
@@ -418,8 +420,8 @@ void MMSieve::Container<T, HookPtr>::inspectHand() noexcept{
418420
std::cout << "hand: ";
419421
if (hand==nullptr)std::cout<<"null" << std::endl;
420422
else {
421-
std::cout << hand->getKey().toString();
422-
std::cout<<", visited: "<< isAccessed(*hand)<< std::endl;
423+
std::cout << hand->getKey().toString();
424+
std::cout<<", visited: "<< isAccessed(*hand)<< std::endl;
423425
}
424426
}
425427

0 commit comments

Comments
 (0)