public interface IMappedPageFactory
| Modifier and Type | Method and Description |
|---|---|
IMappedPage |
acquirePage(long index)
Acquire a mapped page with specific index from the factory
|
void |
deleteAllPages()
delete all mapped pages currently available in this factory,
this call will remove all pages from the cache and delete all back files.
|
void |
deletePage(long index)
delete a mapped page with specific index in this factory,
this call will remove the page from the cache if it is cached and
delete back file.
|
void |
deletePages(Set<Long> indexes)
delete mapped pages with a set of specific indexes in this factory,
this call will remove the pages from the cache if they ware cached and
delete back files.
|
void |
deletePagesBefore(long timestamp)
Delete all pages with last modified timestamp before the specific timestamp.
|
void |
deletePagesBeforePageIndex(long pageIndex)
Delete all pages before the specific index
|
void |
flush()
Persist any changes in cached mapped pages
|
Set<String> |
getBackPageFileSet()
A set of back page file names
|
long |
getBackPageFileSize()
Total size of all page files
|
int |
getCacheSize()
For test, get current cache size
|
Set<Long> |
getExistingBackFileIndexSet()
For test, get a list of indexes of current existing back files.
|
long |
getFirstPageIndexBefore(long timestamp)
Get index of a page file with last modified timestamp closest to specific timestamp.
|
String |
getPageDir()
Current set page directory.
|
long |
getPageFileLastModifiedTime(long index)
Get last modified timestamp of page file index
|
Set<Long> |
getPageIndexSetBefore(long timestamp)
Get all indexes of pages with last modified timestamp before the specific timestamp.
|
int |
getPageSize()
Current set page size, when creating pages, the factory will
only create pages with this size.
|
void |
releaseCachedPages()
remove all cached pages from the cache and close resources associated with the cached pages.
|
void |
releasePage(long index)
Return the mapped page to the factory,
calling thread release the page to inform the factory that it has finished with the page,
so the factory get a chance to recycle the page to save memory.
|
IMappedPage acquirePage(long index) throws IOException
index - the index of the pageIOException - exception thrown if there was any IO error during the acquire operationvoid releasePage(long index)
index - the index of the pageint getPageSize()
String getPageDir()
void deletePage(long index)
throws IOException
index - the index of the pageIOException - exception thrown if there was any IO error during the delete operation.void deletePages(Set<Long> indexes) throws IOException
indexes - the indexes of the pagesIOException - exception thrown if IO error occursvoid deleteAllPages()
throws IOException
IOException - exception thrown if there was any IO error during the delete operation.void releaseCachedPages()
throws IOException
IOException - exception thrown if there was any IO error during the release operation.Set<Long> getPageIndexSetBefore(long timestamp)
timestamp - the timestamp to checkvoid deletePagesBefore(long timestamp)
throws IOException
timestamp - the timestamp to checkIOException - exception thrown if there was any IO error during the delete operation.void deletePagesBeforePageIndex(long pageIndex)
throws IOException
pageIndex - page file index to checkIOException - exception thrown if there was any IO error during the delete operation.long getPageFileLastModifiedTime(long index)
index - page indexlong getFirstPageIndexBefore(long timestamp)
timestamp - the timestamp to checkSet<Long> getExistingBackFileIndexSet()
int getCacheSize()
void flush()
Set<String> getBackPageFileSet()
long getBackPageFileSize()
Copyright © 2022. All rights reserved.