public interface PageStore
extends java.lang.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(java.lang.String fileId)
Abort a temporary file.
|
default void |
commit(java.lang.String fileId)
Commit a temporary file.
|
default void |
commit(java.lang.String fileId,
java.lang.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,
java.nio.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.
|
static PageStore create(PageStoreOptions options)
options - the options to instantiate the page storedefault void putTemporary(PageId pageId, byte[] page) throws ResourceExhaustedException, java.io.IOException
pageId - page identifierpage - page dataResourceExhaustedException - when there is not enough space found on diskjava.io.IOException - when the store fails to write this pagedefault void put(PageId pageId, byte[] page) throws ResourceExhaustedException, java.io.IOException
pageId - page identifierpage - page dataResourceExhaustedException - when there is not enough space found on diskjava.io.IOException - when the store fails to write this pagedefault void put(PageId pageId, byte[] page, boolean isTemporary) throws ResourceExhaustedException, java.io.IOException
pageId - page identifierpage - page dataisTemporary - is page data temporaryResourceExhaustedException - when there is not enough space found on diskjava.io.IOException - when the store fails to write this pagevoid put(PageId pageId, java.nio.ByteBuffer page, boolean isTemporary) throws ResourceExhaustedException, java.io.IOException
pageId - page identifierpage - page dataisTemporary - is page data temporaryResourceExhaustedException - when there is not enough space found on diskjava.io.IOException - when the store fails to write this pagedefault int get(PageId pageId, PageReadTargetBuffer buffer) throws java.io.IOException, PageNotFoundException
pageId - page identifierbuffer - destination bufferjava.io.IOException - 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 java.io.IOException, PageNotFoundException
pageId - page identifierpageOffset - offset within pagebytesToRead - bytes to read in this pagebuffer - destination bufferjava.io.IOException - when the store fails to read this pagePageNotFoundException - when the page isn't found in the storejava.lang.IllegalArgumentException - when the page offset exceeds the page sizeint get(PageId pageId, int pageOffset, int bytesToRead, PageReadTargetBuffer buffer, boolean isTemporary) throws java.io.IOException, PageNotFoundException
pageId - page identifierpageOffset - offset within pagebytesToRead - bytes to read in this pagebuffer - destination bufferisTemporary - is page data temporaryjava.io.IOException - when the store fails to read this pagePageNotFoundException - when the page isn't found in the storejava.lang.IllegalArgumentException - when the page offset exceeds the page sizevoid delete(PageId pageId) throws java.io.IOException, PageNotFoundException
pageId - page identifierjava.io.IOException - when the store fails to delete this pagePageNotFoundException - when the page isn't found in the storedefault void commit(java.lang.String fileId)
throws java.io.IOException
fileId - java.io.IOExceptiondefault void commit(java.lang.String fileId,
java.lang.String newFileId)
throws java.io.IOException
fileId - newFileId - java.io.IOExceptiondefault void abort(java.lang.String fileId)
throws java.io.IOException
fileId - java.io.IOExceptionCopyright © 2022. All Rights Reserved.