use of alluxio.client.file.cache.evictor.CacheEvictor in project alluxio by Alluxio.
the class QuotaMetaStore method removePage.
@Override
public PageInfo removePage(PageId pageId) throws PageNotFoundException {
PageInfo pageInfo = super.removePage(pageId);
for (CacheScope cacheScope = pageInfo.getScope(); cacheScope != CacheScope.GLOBAL; cacheScope = cacheScope.parent()) {
mBytesInScope.computeIfPresent(cacheScope, (k, v) -> v - pageInfo.getPageSize());
CacheEvictor evictor = mCacheEvictors.computeIfAbsent(cacheScope, k -> mSupplier.get());
evictor.updateOnDelete(pageId);
}
return pageInfo;
}
use of alluxio.client.file.cache.evictor.CacheEvictor in project alluxio by Alluxio.
the class QuotaMetaStore method getPageInfo.
@Override
public PageInfo getPageInfo(PageId pageId) throws PageNotFoundException {
PageInfo pageInfo = super.getPageInfo(pageId);
for (CacheScope cacheScope = pageInfo.getScope(); cacheScope != CacheScope.GLOBAL; cacheScope = cacheScope.parent()) {
CacheEvictor evictor = mCacheEvictors.computeIfAbsent(cacheScope, k -> mSupplier.get());
evictor.updateOnPut(pageId);
}
return pageInfo;
}
use of alluxio.client.file.cache.evictor.CacheEvictor in project alluxio by Alluxio.
the class QuotaMetaStore method reset.
@Override
public void reset() {
super.reset();
for (CacheEvictor evictor : mCacheEvictors.values()) {
evictor.reset();
}
mBytesInScope.clear();
}
use of alluxio.client.file.cache.evictor.CacheEvictor in project alluxio by Alluxio.
the class QuotaMetaStore method addPage.
@Override
public void addPage(PageId pageId, PageInfo pageInfo) {
super.addPage(pageId, pageInfo);
for (CacheScope cacheScope = pageInfo.getScope(); cacheScope != CacheScope.GLOBAL; cacheScope = cacheScope.parent()) {
mBytesInScope.compute(cacheScope, (k, v) -> (v == null) ? pageInfo.getPageSize() : v + pageInfo.getPageSize());
CacheEvictor evictor = mCacheEvictors.computeIfAbsent(cacheScope, k -> mSupplier.get());
evictor.updateOnPut(pageId);
}
}
Aggregations