public class MemoryPageStoreDir extends Object
LOG
Constructor and Description |
---|
MemoryPageStoreDir(PageStoreOptions pageStoreOptions,
MemoryPageStore pageStore,
CacheEvictor cacheEvictor)
Constructor of MemPageStoreDir.
|
Modifier and Type | Method and Description |
---|---|
void |
abort(String fileId)
Abort a temporary file.
|
void |
close()
Close the page store dir.
|
void |
commit(String fileId,
String newFileId)
Commit a temporary file with a new file ID.
|
long |
deletePage(PageInfo pageInfo) |
void |
deleteTempPage(PageInfo pageInfo) |
long |
getCachedBytes() |
long |
getCapacityBytes() |
CacheEvictor |
getEvictor() |
PageStore |
getPageStore() |
Path |
getRootPath() |
Optional<CacheUsage> |
getUsage()
Gets cache usage.
|
boolean |
hasFile(String fileId) |
boolean |
hasTempFile(String fileId) |
void |
putPage(PageInfo pageInfo) |
boolean |
putTempFile(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<Optional<PageInfo>> pageInfoConsumer)
Scan the pages under this dir.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, commit, createPageStoreDir, createPageStoreDirs, getFileBucket
public MemoryPageStoreDir(PageStoreOptions pageStoreOptions, MemoryPageStore pageStore, CacheEvictor cacheEvictor)
pageStoreOptions
- page store optionspageStore
- the PageStore instancecacheEvictor
- the evictorpublic PageStore getPageStore()
public void reset()
PageStoreDir
public void scanPages(java.util.function.Consumer<Optional<PageInfo>> pageInfoConsumer)
PageStoreDir
public Optional<CacheUsage> getUsage()
CacheStatus
public Path getRootPath()
getRootPath
in interface PageStoreDir
public long getCapacityBytes()
getCapacityBytes
in interface PageStoreDir
public long getCachedBytes()
getCachedBytes
in interface PageStoreDir
public void putPage(PageInfo pageInfo)
putPage
in interface PageStoreDir
public void putTempPage(PageInfo pageInfo)
putTempPage
in interface PageStoreDir
public long deletePage(PageInfo pageInfo)
deletePage
in interface PageStoreDir
public void deleteTempPage(PageInfo pageInfo)
deleteTempPage
in interface PageStoreDir
public boolean putTempFile(String fileId)
putTempFile
in interface PageStoreDir
fileId
- file idpublic boolean reserve(long bytes)
reserve
in interface PageStoreDir
public long release(long bytes)
PageStoreDir
release
in interface PageStoreDir
public boolean hasFile(String fileId)
hasFile
in interface PageStoreDir
public boolean hasTempFile(String fileId)
hasTempFile
in interface PageStoreDir
public CacheEvictor getEvictor()
getEvictor
in interface PageStoreDir
public void close()
PageStoreDir
close
in interface PageStoreDir
public void commit(String fileId, String newFileId) throws IOException
PageStoreDir
commit
in interface PageStoreDir
IOException
public void abort(String fileId) throws IOException
PageStoreDir
abort
in interface PageStoreDir
IOException
Copyright © 2023. All Rights Reserved.