@NotThreadSafe public class MemoryPageStore extends java.lang.Object implements PageStore
MemoryPageStore is an implementation of PageStore which
stores all pages in memory.PageStore.Metrics| Constructor and Description |
|---|
MemoryPageStore(int pageSize)
Constructor of MemoryPageStore.
|
| 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,
PageReadTargetBuffer target,
boolean isTemporary)
Gets part of a page from the store to the destination buffer.
|
PageId |
getKeyFromPageId(PageId pageId) |
void |
put(PageId pageId,
java.nio.ByteBuffer page,
boolean isTemporary)
Writes a new page from a source channel to the store.
|
void |
reset() |
public MemoryPageStore(int pageSize)
pageSize - page sizepublic void put(PageId pageId, java.nio.ByteBuffer page, boolean isTemporary) throws java.io.IOException
PageStoreput in interface PageStorepageId - 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 pagepublic int get(PageId pageId, int pageOffset, int bytesToRead, PageReadTargetBuffer target, boolean isTemporary) throws java.io.IOException, PageNotFoundException
PageStoreget in interface PageStorepageId - page identifierpageOffset - offset within pagebytesToRead - bytes to read in this pagetarget - destination bufferisTemporary - is page data temporaryjava.io.IOException - when the store fails to read this pagePageNotFoundException - when the page isn't found in the storepublic void delete(PageId pageId) throws java.io.IOException, PageNotFoundException
PageStoredelete in interface PageStorepageId - page identifierjava.io.IOException - when the store fails to delete this pagePageNotFoundException - when the page isn't found in the storepublic PageId getKeyFromPageId(PageId pageId)
pageId - page Idpublic void close()
close in interface java.lang.AutoCloseablepublic void reset()
Copyright © 2022. All Rights Reserved.