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 |
---|---|
default void |
abort(String fileId)
Abort a temporary file.
|
default void |
commit(String fileId)
Commit a temporary file.
|
default void |
commit(String fileId,
String newFileId)
Commit a temporary file with a new file ID.
|
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,
int pageOffset,
int bytesToRead,
PageReadTargetBuffer buffer)
Gets part of a page from the store to the destination buffer.
|
int |
get(PageId pageId,
int pageOffset,
int bytesToRead,
PageReadTargetBuffer buffer,
boolean isTemporary)
Gets part of a page from the store to the destination buffer.
|
default int |
get(PageId pageId,
PageReadTargetBuffer buffer)
Gets 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.
|
default void |
put(PageId pageId,
byte[] page,
boolean isTemporary)
Writes a new page from a source channel to the store.
|
void |
put(PageId pageId,
ByteBuffer 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 pagedefault void 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 pagevoid put(PageId pageId, ByteBuffer 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, PageReadTargetBuffer 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, PageReadTargetBuffer buffer) throws IOException, PageNotFoundException
pageId
- page identifierpageOffset
- offset within pagebytesToRead
- bytes to read in this pagebuffer
- destination 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, PageReadTargetBuffer buffer, boolean isTemporary) throws IOException, PageNotFoundException
pageId
- page identifierpageOffset
- offset within pagebytesToRead
- bytes to read in this pagebuffer
- destination 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 storedefault void commit(String fileId) throws IOException
fileId
- IOException
default void commit(String fileId, String newFileId) throws IOException
fileId
- newFileId
- IOException
default void abort(String fileId) throws IOException
fileId
- IOException
Copyright © 2023. All Rights Reserved.