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(String fileId,
long fileLength) |
long |
bytes() |
void |
commitFile(String fileId,
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) |
ReadWriteLock |
getLock() |
PageInfo |
getPageInfo(PageId pageId) |
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 IOException
options
- the options of cacheIOException
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(String fileId, String newFileId) throws PageNotFoundException
fileId
- the temp file to commitnewFileId
- the new file name of the file after committingPageNotFoundException
List<PageStoreDir> getStoreDirs()
PageStoreDir allocate(String fileId, long fileLength)
fileId
- fileLength
- PageInfo getPageInfo(PageId pageId) throws PageNotFoundException
pageId
- page identifierPageNotFoundException
PageInfo removePage(PageId pageId) throws PageNotFoundException
pageId
- page identifierPageNotFoundException
long bytes()
long numPages()
void reset()
default PageInfo evict(PageStoreDir pageStoreDir)
pageStoreDir
- PageInfo evict(CacheScope cacheScope, PageStoreDir pageStoreDir)
cacheScope
- pageStoreDir
- Copyright © 2023. All Rights Reserved.