public class NoExceptionCacheManager extends java.lang.Object implements CacheManager
CacheManager.Factory, CacheManager.State| Constructor and Description |
|---|
NoExceptionCacheManager(CacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
append(PageId pageId,
int appendAt,
byte[] page,
CacheContext cacheContext) |
void |
close() |
boolean |
delete(PageId pageId)
Deletes a page from the cache.
|
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.
|
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.
|
java.util.List<PageId> |
getCachedPageIdsByFileId(java.lang.String fileId,
long fileLength)
Get page ids by the given file id.
|
boolean |
put(PageId pageId,
byte[] 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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitput, putpublic NoExceptionCacheManager(CacheManager cacheManager)
cacheManager - delegated cache managerpublic boolean put(PageId pageId, byte[] page)
CacheManagerput in interface CacheManagerpageId - page identifierpage - page datapublic boolean put(PageId pageId, java.nio.ByteBuffer page, CacheContext cacheContext)
CacheManagerput in interface CacheManagerpageId - page identifierpage - page datacacheContext - cache related contextpublic int get(PageId pageId, int bytesToRead, byte[] buffer, int offsetInBuffer)
CacheManagerget in interface CacheManagerpageId - page identifierbytesToRead - number of bytes to read in this pagebuffer - destination buffer to writeoffsetInBuffer - offset in the destination buffer to writepublic int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int offsetInBuffer)
CacheManagerget in interface CacheManagerpageId - page identifierpageOffset - offset into the pagebytesToRead - number of bytes to read in this pagebuffer - destination buffer to writeoffsetInBuffer - offset in the destination buffer to writepublic int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int offsetInBuffer, CacheContext cacheContext)
CacheManagerget in interface CacheManagerpageId - 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 contextpublic int get(PageId pageId, int pageOffset, int bytesToRead, PageReadTargetBuffer buffer, CacheContext cacheContext)
CacheManagerget in interface CacheManagerpageId - page identifierpageOffset - offset into the pagebytesToRead - number of bytes to read in this pagebuffer - destination buffer to writecacheContext - cache related contextpublic boolean delete(PageId pageId)
CacheManagerdelete in interface CacheManagerpageId - page identifierpublic CacheManager.State state()
state in interface CacheManagerpublic boolean append(PageId pageId, int appendAt, byte[] page, CacheContext cacheContext)
append in interface CacheManagerpublic void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exceptionpublic java.util.List<PageId> getCachedPageIdsByFileId(java.lang.String fileId, long fileLength)
CacheManagergetCachedPageIdsByFileId in interface CacheManagerfileId - file identifierfileLength - file length (this will not be needed after we have per-file metadata)Copyright © 2022. All Rights Reserved.