public class LocalPageStoreDir extends Object
Constructor and Description |
---|
LocalPageStoreDir(LocalPageStoreOptions pageStoreOptions,
PageStore pageStore,
CacheEvictor evictor)
Constructor for LocalCacheDir.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the page store dir.
|
long |
deletePage(PageInfo pageInfo) |
long |
getCachedBytes() |
long |
getCapacityBytes() |
CacheEvictor |
getEvictor() |
PageStore |
getPageStore()
Getter for pageStore.
|
Path |
getRootPath() |
boolean |
hasFile(String fileId) |
boolean |
putPage(PageInfo pageInfo) |
boolean |
putTempFile(String fileId) |
long |
release(int bytes)
Release the pre-reserved space.
|
boolean |
reserve(int bytes) |
void |
reset()
Reset page store.
|
void |
scanPages(java.util.function.Consumer<Optional<PageInfo>> pageInfoConsumer)
Gets a stream of all pages from the page store.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, createPageStoreDir, createPageStoreDirs, getFileBucket
public LocalPageStoreDir(LocalPageStoreOptions pageStoreOptions, PageStore pageStore, CacheEvictor evictor)
pageStoreOptions
- pageStore
- evictor
- public PageStore getPageStore()
public void reset() throws IOException
IOException
public void scanPages(java.util.function.Consumer<Optional<PageInfo>> pageInfoConsumer) throws IOException
IOException
- if any error occurspublic Path getRootPath()
getRootPath
in interface PageStoreDir
public long getCapacityBytes()
getCapacityBytes
in interface PageStoreDir
public long getCachedBytes()
getCachedBytes
in interface PageStoreDir
public boolean putPage(PageInfo pageInfo)
putPage
in interface PageStoreDir
public long deletePage(PageInfo pageInfo)
deletePage
in interface PageStoreDir
public boolean putTempFile(String fileId)
putTempFile
in interface PageStoreDir
public boolean reserve(int bytes)
reserve
in interface PageStoreDir
public long release(int bytes)
PageStoreDir
release
in interface PageStoreDir
public boolean hasFile(String fileId)
hasFile
in interface PageStoreDir
public CacheEvictor getEvictor()
getEvictor
in interface PageStoreDir
public void close()
PageStoreDir
close
in interface PageStoreDir
Copyright © 2023. All Rights Reserved.