public class TimeBoundPageStore extends Object implements PageStore
Constructor and Description |
---|
TimeBoundPageStore(PageStore pageStore,
PageStoreOptions options) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
delete(PageId pageId)
Deletes a page from the store.
|
int |
get(PageId pageId,
int pageOffset,
int bytesToRead,
byte[] buffer,
int bufferOffset)
Gets part of a page from the store to the destination buffer.
|
long |
getCacheSize() |
java.util.stream.Stream<PageInfo> |
getPages()
Gets a stream of all pages from the page store.
|
void |
put(PageId pageId,
byte[] page)
Writes a new page from a source channel to the store.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, get, getStorePath, initialize, open
public TimeBoundPageStore(PageStore pageStore, PageStoreOptions options)
pageStore
- page storeoptions
- time out in mspublic void put(PageId pageId, byte[] page) throws ResourceExhaustedException, IOException
PageStore
put
in interface PageStore
pageId
- page identifierpage
- page dataResourceExhaustedException
- when there is not enough space found on diskIOException
- when the store fails to write this pagepublic int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int bufferOffset) throws IOException, PageNotFoundException
PageStore
get
in interface PageStore
pageId
- page identifierpageOffset
- offset within pagebytesToRead
- bytes to read in this pagebuffer
- destination bufferbufferOffset
- offset in bufferIOException
- when the store fails to read this pagePageNotFoundException
- when the page isn't found in the storepublic void delete(PageId pageId) throws IOException, PageNotFoundException
PageStore
delete
in interface PageStore
pageId
- page identifierIOException
- when the store fails to delete this pagePageNotFoundException
- when the page isn't found in the storepublic java.util.stream.Stream<PageInfo> getPages() throws IOException
PageStore
getPages
in interface PageStore
IOException
- if any error occurspublic long getCacheSize()
getCacheSize
in interface PageStore
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2023. All Rights Reserved.