public interface PageStoreDir
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(java.lang.String fileId)
Abort a temporary file.
|
static void |
clear(java.nio.file.Path rootPath)
Clear the dir.
|
void |
close()
Close the page store dir.
|
default void |
commit(java.lang.String fileId)
Commit a temporary file.
|
void |
commit(java.lang.String fileId,
java.lang.String newFileId)
Commit a temporary file with a new file ID.
|
static PageStoreDir |
createPageStoreDir(CacheEvictorOptions cacheEvictorOptions,
PageStoreOptions pageStoreOptions)
Create an instance of PageStoreDir.
|
static java.util.List<PageStoreDir> |
createPageStoreDirs(CacheManagerOptions options)
Create a list of PageStoreDir based on the configuration.
|
long |
deletePage(PageInfo bytes) |
long |
getCachedBytes() |
long |
getCapacityBytes() |
CacheEvictor |
getEvictor() |
static java.lang.String |
getFileBucket(int fileBuckets,
java.lang.String fileId) |
PageStore |
getPageStore() |
java.nio.file.Path |
getRootPath() |
boolean |
hasFile(java.lang.String fileId) |
boolean |
hasTempFile(java.lang.String fileId) |
void |
putPage(PageInfo pageInfo) |
boolean |
putTempFile(java.lang.String fileId) |
void |
putTempPage(PageInfo pageInfo) |
long |
release(long bytes)
Release the pre-reserved space.
|
boolean |
reserve(long bytes) |
void |
reset()
Reset page store.
|
void |
scanPages(java.util.function.Consumer<java.util.Optional<PageInfo>> pageInfoConsumer)
Scan the pages under this dir.
|
static java.util.List<PageStoreDir> createPageStoreDirs(CacheManagerOptions options) throws java.io.IOException
options - of cache managerjava.io.IOExceptionstatic PageStoreDir createPageStoreDir(CacheEvictorOptions cacheEvictorOptions, PageStoreOptions pageStoreOptions)
cacheEvictorOptions - pageStoreOptions - static java.lang.String getFileBucket(int fileBuckets,
java.lang.String fileId)
fileBuckets - number of bucketsfileId - file idstatic void clear(java.nio.file.Path rootPath)
throws java.io.IOException
rootPath - java.io.IOException - when failed to clean up the specific locationjava.nio.file.Path getRootPath()
PageStore getPageStore()
long getCapacityBytes()
void reset()
throws java.io.IOException
java.io.IOExceptionvoid scanPages(java.util.function.Consumer<java.util.Optional<PageInfo>> pageInfoConsumer) throws java.io.IOException
pageInfoConsumer - java.io.IOExceptionlong getCachedBytes()
void putPage(PageInfo pageInfo)
pageInfo - void putTempPage(PageInfo pageInfo)
pageInfo - boolean putTempFile(java.lang.String fileId)
fileId - file idboolean reserve(long bytes)
bytes - long deletePage(PageInfo bytes)
bytes - long release(long bytes)
bytes - boolean hasFile(java.lang.String fileId)
fileId - boolean hasTempFile(java.lang.String fileId)
fileId - CacheEvictor getEvictor()
void close()
default void commit(java.lang.String fileId)
throws java.io.IOException
fileId - java.io.IOExceptionvoid commit(java.lang.String fileId,
java.lang.String newFileId)
throws java.io.IOException
fileId - newFileId - java.io.IOExceptionvoid abort(java.lang.String fileId)
throws java.io.IOException
fileId - java.io.IOExceptionCopyright © 2022. All Rights Reserved.