Search in sources :

Example 1 with CacheEvictor

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;
}
Also used : CacheEvictor(alluxio.client.file.cache.evictor.CacheEvictor) CacheScope(alluxio.client.quota.CacheScope)

Example 2 with CacheEvictor

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;
}
Also used : CacheEvictor(alluxio.client.file.cache.evictor.CacheEvictor) CacheScope(alluxio.client.quota.CacheScope)

Example 3 with CacheEvictor

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();
}
Also used : CacheEvictor(alluxio.client.file.cache.evictor.CacheEvictor)

Example 4 with CacheEvictor

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);
    }
}
Also used : CacheEvictor(alluxio.client.file.cache.evictor.CacheEvictor) CacheScope(alluxio.client.quota.CacheScope)

Aggregations

CacheEvictor (alluxio.client.file.cache.evictor.CacheEvictor)4 CacheScope (alluxio.client.quota.CacheScope)3