@NotThreadSafe public class QuotaPageMetaStore extends DefaultPageMetaStore
mLock
Constructor and Description |
---|
QuotaPageMetaStore(CacheEvictorOptions cacheEvictorOptions,
List<PageStoreDir> dirs) |
Modifier and Type | Method and Description |
---|---|
void |
addPage(PageId pageId,
PageInfo pageInfo)
Adds a new page to the cache.
|
long |
bytes(CacheScope cacheScope) |
PageInfo |
evict(CacheScope cacheScope,
PageStoreDir pageStoreDir) |
PageInfo |
getPageInfo(PageId pageId) |
PageInfo |
removePage(PageId pageId)
Removes a page.
|
void |
reset()
Resets the meta store.
|
addTempPage, allocate, bytes, commitFile, getLock, getStoreDirs, hasPage, numPages
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, evict
public QuotaPageMetaStore(CacheEvictorOptions cacheEvictorOptions, List<PageStoreDir> dirs)
cacheEvictorOptions
- options of cache evictordirs
- storage directoriespublic void addPage(PageId pageId, PageInfo pageInfo)
PageMetaStore
addPage
in interface PageMetaStore
addPage
in class DefaultPageMetaStore
pageId
- page identifierpageInfo
- info of the pagepublic PageInfo getPageInfo(PageId pageId) throws PageNotFoundException
getPageInfo
in interface PageMetaStore
getPageInfo
in class DefaultPageMetaStore
pageId
- page identifierPageNotFoundException
public PageInfo removePage(PageId pageId) throws PageNotFoundException
PageMetaStore
removePage
in interface PageMetaStore
removePage
in class DefaultPageMetaStore
pageId
- page identifierPageNotFoundException
public long bytes(CacheScope cacheScope)
cacheScope
- scope to querypublic void reset()
PageMetaStore
reset
in interface PageMetaStore
reset
in class DefaultPageMetaStore
@Nullable public PageInfo evict(CacheScope cacheScope, PageStoreDir pageStoreDir)
evict
in interface PageMetaStore
evict
in class DefaultPageMetaStore
cacheScope
- scope to evictpageStoreDir
- the page store dir targeted to evictCopyright © 2023. All Rights Reserved.