public interface PageStore extends AutoCloseable
Modifier and Type | Interface and Description |
---|---|
static class |
PageStore.Metrics
Metrics.
|
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
static PageStore |
create(PageStoreOptions options)
Create an instance of PageStore.
|
void |
delete(PageId pageId)
Deletes a page from the store.
|
default int |
get(PageId pageId,
byte[] buffer)
Gets a page from the store to the destination buffer.
|
default int |
get(PageId pageId,
int pageOffset,
int bytesToRead,
byte[] buffer,
int bufferOffset)
Gets part of a page from the store to the destination buffer.
|
int |
get(PageId pageId,
int pageOffset,
int bytesToRead,
byte[] buffer,
int bufferOffset,
boolean isTemporary)
Gets part of a page from the store to the destination buffer.
|
default void |
put(PageId pageId,
byte[] page)
Writes a new page from a source channel to the store.
|
void |
put(PageId pageId,
byte[] page,
boolean isTemporary)
Writes a new page from a source channel to the store.
|
default void |
putTemporary(PageId pageId,
byte[] page)
Writes a new temporary page from a source channel to the store.
|
close
static PageStore create(PageStoreOptions options)
options
- the options to instantiate the page storedefault void putTemporary(PageId pageId, byte[] page) throws ResourceExhaustedException, IOException
pageId
- page identifierpage
- page dataResourceExhaustedException
- when there is not enough space found on diskIOException
- when the store fails to write this pagedefault void put(PageId pageId, byte[] page) throws ResourceExhaustedException, IOException
pageId
- page identifierpage
- page dataResourceExhaustedException
- when there is not enough space found on diskIOException
- when the store fails to write this pagevoid put(PageId pageId, byte[] page, boolean isTemporary) throws ResourceExhaustedException, IOException
pageId
- page identifierpage
- page dataisTemporary
- is page data temporaryResourceExhaustedException
- when there is not enough space found on diskIOException
- when the store fails to write this pagedefault int get(PageId pageId, byte[] buffer) throws IOException, PageNotFoundException
pageId
- page identifierbuffer
- destination bufferIOException
- when the store fails to read this pagePageNotFoundException
- when the page isn't found in the storedefault int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int bufferOffset) throws IOException, PageNotFoundException
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 storeIllegalArgumentException
- when the page offset exceeds the page sizeint get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int bufferOffset, boolean isTemporary) throws IOException, PageNotFoundException
pageId
- page identifierpageOffset
- offset within pagebytesToRead
- bytes to read in this pagebuffer
- destination bufferbufferOffset
- offset in bufferisTemporary
- is page data temporaryIOException
- when the store fails to read this pagePageNotFoundException
- when the page isn't found in the storeIllegalArgumentException
- when the page offset exceeds the page sizevoid delete(PageId pageId) throws IOException, PageNotFoundException
pageId
- page identifierIOException
- when the store fails to delete this pagePageNotFoundException
- when the page isn't found in the storeCopyright © 2023. All Rights Reserved.