@NotThreadSafe public class RocksPageStore extends Object implements PageStore
PageStore.Metrics
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,
byte[] buffer,
int bufferOffset)
Gets part of a page from the store to the destination buffer.
|
long |
getCacheSize() |
java.util.stream.Stream<PageInfo> |
getPages()
Gets a stream of all pages from the page store.
|
static RocksPageStore |
open(RocksPageStoreOptions options) |
void |
put(PageId pageId,
byte[] page)
Writes a new page from a source channel to the store.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, get, getStorePath, initialize, open
public static RocksPageStore open(RocksPageStoreOptions options) throws IOException
options
- options for the rocks page storePageStore
backed by RocksDBIOException
- if I/O error happenspublic void put(PageId pageId, byte[] page) throws IOException
PageStore
put
in interface PageStore
pageId
- page identifierpage
- page dataIOException
public int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int bufferOffset) throws IOException, PageNotFoundException
PageStore
get
in interface PageStore
pageId
- page identifierpageOffset
- offset within pagebytesToRead
- bytes to read in this pagebuffer
- destination bufferbufferOffset
- offset in bufferIOException
- when the store fails to read this pagePageNotFoundException
- when the page isn't found in the storepublic void delete(PageId pageId) throws PageNotFoundException
PageStore
delete
in interface PageStore
pageId
- page identifierPageNotFoundException
- when the page isn't found in the storepublic void close()
close
in interface AutoCloseable
public java.util.stream.Stream<PageInfo> getPages()
PageStore
public long getCacheSize()
getCacheSize
in interface PageStore
Copyright © 2023. All Rights Reserved.