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.
|
default void |
delete(PageId pageId)
Deletes a page from the store.
|
default void |
delete(PageId pageId,
boolean isTemporary)
Deletes a temporary page from the store.
|
default int |
get(PageId pageId,
int pageOffset,
int bytesToRead,
ReadTargetBuffer buffer)
Gets part of a page from the store to the destination buffer.
|
int |
get(PageId pageId,
int pageOffset,
int bytesToRead,
ReadTargetBuffer buffer,
boolean isTemporary)
Gets part of a page from the store to the destination buffer.
|
default int |
get(PageId pageId,
ReadTargetBuffer buffer)
Gets a page from the store to the destination buffer.
|
default DataFileChannel |
getDataFileChannel(PageId pageId,
int pageOffset,
int bytesToRead,
boolean isTemporary)
Get a
DataFileChannel which wraps a FileRegion . |
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, ReadTargetBuffer 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, ReadTargetBuffer 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, ReadTargetBuffer 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 sizedefault void delete(PageId pageId, boolean isTemporary) throws IOException, PageNotFoundException
pageId
- page identifierisTemporary
- whether is to delete the temporary page or notIOException
- when the store fails to delete this pagePageNotFoundException
- when the page isn't found in the storedefault void 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
default DataFileChannel getDataFileChannel(PageId pageId, int pageOffset, int bytesToRead, boolean isTemporary) throws PageNotFoundException
DataFileChannel
which wraps a FileRegion
.pageId
- the page idpageOffset
- the offset inside the pagebytesToRead
- the bytes to readisTemporary
- whether it is temporary or notDataFileChannel
PageNotFoundException
Copyright © 2023. All Rights Reserved.