public interface CacheManager extends AutoCloseable
Modifier and Type | Interface and Description |
---|---|
static class |
CacheManager.Factory
Factory class to get or create a CacheManager.
|
Modifier and Type | Method and Description |
---|---|
boolean |
delete(PageId pageId)
Deletes a page from the cache.
|
default int |
get(PageId pageId,
int bytesToRead,
byte[] buffer,
int offsetInBuffer)
Reads the entire page if the queried page is found in the cache, stores the result in buffer.
|
int |
get(PageId pageId,
int pageOffset,
int bytesToRead,
byte[] buffer,
int offsetInBuffer)
Reads a part of a page if the queried page is found in the cache, stores the result in
buffer.
|
boolean |
put(PageId pageId,
byte[] page)
Puts a page into the cache manager.
|
close
boolean put(PageId pageId, byte[] page)
pageId
- page identifierpage
- page datadefault int get(PageId pageId, int bytesToRead, byte[] buffer, int offsetInBuffer)
pageId
- page identifierbytesToRead
- number of bytes to read in this pagebuffer
- destination buffer to writeoffsetInBuffer
- offset in the destination buffer to writeint get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int offsetInBuffer)
pageId
- page identifierpageOffset
- offset into the pagebytesToRead
- number of bytes to read in this pagebuffer
- destination buffer to writeoffsetInBuffer
- offset in the destination buffer to writeboolean delete(PageId pageId)
pageId
- page identifierCopyright © 2023. All Rights Reserved.