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,
ReadTargetBuffer target,
boolean isTemporary)
Gets part of a page from the store to the destination buffer.
|
DataFileChannel |
getDataFileChannel(PageId pageId,
int pageOffset,
int bytesToRead,
boolean isTemporary)
Get a
DataFileChannel which wraps a FileRegion . |
void |
put(PageId pageId,
ByteBuffer page,
boolean isTemporary)
Writes a new page from a source channel to the store.
|
public TimeBoundPageStore(PageStore pageStore, PageStoreOptions options)
pageStore
- page storeoptions
- time out in mspublic void put(PageId pageId, ByteBuffer page, boolean isTemporary) throws IOException
PageStore
put
in interface PageStore
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 pagepublic int get(PageId pageId, int pageOffset, int bytesToRead, ReadTargetBuffer target, boolean isTemporary) throws IOException, PageNotFoundException
PageStore
get
in interface PageStore
pageId
- page identifierpageOffset
- offset within pagebytesToRead
- bytes to read in this pagetarget
- destination bufferisTemporary
- is page data temporaryIOException
- 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 DataFileChannel getDataFileChannel(PageId pageId, int pageOffset, int bytesToRead, boolean isTemporary) throws PageNotFoundException
PageStore
DataFileChannel
which wraps a FileRegion
.getDataFileChannel
in interface PageStore
pageId
- the page idpageOffset
- the offset inside the pagebytesToRead
- the bytes to readisTemporary
- whether it is temporary or notDataFileChannel
PageNotFoundException
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2023. All Rights Reserved.