public interface CacheManager
extends java.lang.AutoCloseable
| Modifier and Type | Interface and Description |
|---|---|
static class |
CacheManager.Factory
Factory class to get or create a CacheManager.
|
static class |
CacheManager.State
State of a cache.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
append(PageId pageId,
int appendAt,
byte[] page,
CacheContext cacheContext) |
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.
|
default 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.
|
default int |
get(PageId pageId,
int pageOffset,
int bytesToRead,
byte[] buffer,
int offsetInBuffer,
CacheContext cacheContext)
Reads a part of a page if the queried page is found in the cache, stores the result in buffer.
|
int |
get(PageId pageId,
int pageOffset,
int bytesToRead,
PageReadTargetBuffer buffer,
CacheContext cacheContext)
Reads a part of a page if the queried page is found in the cache, stores the result in buffer.
|
default java.util.List<PageId> |
getCachedPageIdsByFileId(java.lang.String fileId,
long fileLength)
Get page ids by the given file id.
|
default boolean |
put(PageId pageId,
byte[] page)
Puts a page into the cache manager.
|
default boolean |
put(PageId pageId,
byte[] page,
CacheContext cacheContext)
Puts a page into the cache manager with scope and quota respected.
|
default boolean |
put(PageId pageId,
java.nio.ByteBuffer page)
Puts a page into the cache manager.
|
boolean |
put(PageId pageId,
java.nio.ByteBuffer page,
CacheContext cacheContext)
Puts a page into the cache manager with scope and quota respected.
|
CacheManager.State |
state() |
default boolean put(PageId pageId, byte[] page)
pageId - page identifierpage - page datadefault boolean put(PageId pageId, java.nio.ByteBuffer page)
pageId - page identifierpage - page datadefault boolean put(PageId pageId, byte[] page, CacheContext cacheContext)
pageId - page identifierpage - page datacacheContext - cache related contextboolean put(PageId pageId, java.nio.ByteBuffer page, CacheContext cacheContext)
pageId - page identifierpage - page datacacheContext - cache related contextdefault 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 writedefault int 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 writedefault int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int offsetInBuffer, CacheContext cacheContext)
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 writecacheContext - cache related contextint get(PageId pageId, int pageOffset, int bytesToRead, PageReadTargetBuffer buffer, CacheContext cacheContext)
pageId - page identifierpageOffset - offset into the pagebytesToRead - number of bytes to read in this pagebuffer - destination buffer to writecacheContext - cache related contextdefault java.util.List<PageId> getCachedPageIdsByFileId(java.lang.String fileId, long fileLength)
fileId - file identifierfileLength - file length (this will not be needed after we have per-file metadata)boolean delete(PageId pageId)
pageId - page identifierCacheManager.State state()
boolean append(PageId pageId, int appendAt, byte[] page, CacheContext cacheContext)
pageId - appendAt - page - cacheContext - Copyright © 2022. All Rights Reserved.