@NotThreadSafe public class RocksPageStore extends Object implements PageStore
Modifier and Type | Method and Description |
---|---|
void |
close() |
static RocksPageStore |
create(RocksPageStoreOptions options) |
void |
delete(PageId pageId,
long pageSize)
Deletes a page from the store.
|
ReadableByteChannel |
get(PageId pageId,
int pageOffset)
Gets part of a page from the store to the destination channel.
|
long |
getCacheSize() |
java.util.stream.Stream<PageInfo> |
getPages()
Gets a stream of all pages from the page store.
|
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
public static RocksPageStore create(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 ReadableByteChannel get(PageId pageId, int pageOffset) throws IOException, PageNotFoundException
PageStore
get
in interface PageStore
pageId
- page identifierpageOffset
- offset within pageIOException
- when the store fails to read this pagePageNotFoundException
- when the page isn't found in the storepublic void delete(PageId pageId, long pageSize) throws PageNotFoundException
PageStore
delete
in interface PageStore
pageId
- page identifierpageSize
- page size in bytesPageNotFoundException
- 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.