Remove explicit tryEvict(x) as it is unused and it is functionally replaced by prioritizeEviction(x).

This commit is contained in:
Steve Atherton 2021-11-27 03:26:34 -08:00
parent 09fedc429a
commit 0f5535fce1
2 changed files with 0 additions and 36 deletions

View File

@ -176,7 +176,6 @@ public:
int priority,
bool cacheable,
bool nohit) = 0;
virtual bool tryEvictPage(LogicalPageID id) = 0;
virtual Version getVersion() const = 0;
virtual Key getMetaKey() const = 0;

View File

@ -1915,23 +1915,6 @@ public:
}
}
// Try to evict the item at index from cache
// Returns true if item is evicted or was not present in cache
bool tryEvict(const IndexType& index) {
auto i = cache.find(index);
if (i == cache.end() || !i->second.item.evictable()) {
return false;
}
Entry& toEvict = i->second;
if (toEvict.hits == 0) {
++g_redwoodMetrics.metric.pagerEvictUnhit;
}
currentSize -= toEvict.size;
evictionOrder.erase(evictionOrder.iterator_to(toEvict));
cache.erase(i);
return true;
}
// Get the object for i or create a new one.
// After a get(), the object for i is the last in evictionOrder.
// If noHit is set, do not consider this access to be cache hit if the object is present
@ -2973,11 +2956,6 @@ public:
return readPhysicalPage(self, pageID, ioMaxPriority, true);
}
bool tryEvictPage(LogicalPageID logicalID, Version v) {
PhysicalPageID physicalID = getPhysicalPageID(logicalID, v);
return pageCache.tryEvict(physicalID);
}
// Reads the most recent version of pageID, either previously committed or written using updatePage()
// in the current commit
Future<Reference<ArenaPage>> readPage(PagerEventReasons reason,
@ -3935,8 +3913,6 @@ public:
[=](Reference<ArenaPage> p) { return Reference<const ArenaPage>(std::move(p)); });
}
bool tryEvictPage(LogicalPageID id) override { return pager->tryEvictPage(id, version); }
Key getMetaKey() const override { return metaKey; }
Version getVersion() const override { return version; }
@ -5698,17 +5674,6 @@ private:
return records;
}
// Try to evict a BTree page from the pager cache.
// Returns true if, at the end of the call, the page is no longer in cache,
// so the caller can assume its ArenaPage reference is the only one.
bool tryEvictPage(IPagerSnapshot* pager, BTreePageIDRef id) {
// If it's an oversized page, currently it cannot be in the cache
if (id.size() > 0) {
return true;
}
return pager->tryEvictPage(id.front());
}
ACTOR static Future<Reference<const ArenaPage>> readPage(PagerEventReasons reason,
unsigned int level,
Reference<IPagerSnapshot> snapshot,