public interface PageMetaStore
| Modifier and Type | Method and Description |
|---|---|
void |
addPage(PageId pageId,
PageInfo pageInfo)
Adds a new page to the cache.
|
void |
addTempPage(PageId pageId,
PageInfo pageInfo)
Adds a new temp page to the cache.
|
PageStoreDir |
allocate(java.lang.String fileId,
long fileLength) |
long |
bytes() |
void |
commitFile(java.lang.String fileId,
java.lang.String newFileId)
Commits a temp file so that all its pages become permanent.
|
static PageMetaStore |
create(CacheManagerOptions options) |
PageInfo |
evict(CacheScope cacheScope,
PageStoreDir pageStoreDir) |
default PageInfo |
evict(PageStoreDir pageStoreDir) |
java.util.concurrent.locks.ReadWriteLock |
getLock() |
PageInfo |
getPageInfo(PageId pageId) |
java.util.List<PageStoreDir> |
getStoreDirs()
Gets the storage directories.
|
boolean |
hasPage(PageId pageId) |
long |
numPages() |
PageInfo |
removePage(PageId pageId)
Removes a page.
|
void |
reset()
Resets the meta store.
|
static PageMetaStore create(CacheManagerOptions options) throws java.io.IOException
options - the options of cachejava.io.IOExceptionjava.util.concurrent.locks.ReadWriteLock getLock()
boolean hasPage(PageId pageId)
pageId - page identifiervoid addPage(PageId pageId, PageInfo pageInfo)
pageId - page identifierpageInfo - info of the pagevoid addTempPage(PageId pageId, PageInfo pageInfo)
pageId - page identifierpageInfo - info of the pagevoid commitFile(java.lang.String fileId,
java.lang.String newFileId)
throws PageNotFoundException
fileId - the temp file to commitnewFileId - the new file name of the file after committingPageNotFoundExceptionjava.util.List<PageStoreDir> getStoreDirs()
PageStoreDir allocate(java.lang.String fileId, long fileLength)
fileId - fileLength - PageInfo getPageInfo(PageId pageId) throws PageNotFoundException
pageId - page identifierPageNotFoundExceptionPageInfo removePage(PageId pageId) throws PageNotFoundException
pageId - page identifierPageNotFoundExceptionlong bytes()
long numPages()
void reset()
default PageInfo evict(PageStoreDir pageStoreDir)
pageStoreDir - PageInfo evict(CacheScope cacheScope, PageStoreDir pageStoreDir)
cacheScope - pageStoreDir - Copyright © 2022. All Rights Reserved.