public class NoExceptionCacheManager extends Object implements CacheManager
CacheManager.Factory, CacheManager.State
Constructor and Description |
---|
NoExceptionCacheManager(CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
put(PageId pageId,
byte[] page)
Puts a page into the cache manager.
|
boolean |
put(PageId pageId,
byte[] page,
CacheScope cacheScope,
CacheQuota cacheQuota)
Puts a page into the cache manager with scope and quota respected.
|
CacheManager.State |
state() |
public NoExceptionCacheManager(CacheManager cacheManager)
cacheManager
- delegated cache managerpublic boolean put(PageId pageId, byte[] page)
CacheManager
put
in interface CacheManager
pageId
- page identifierpage
- page datapublic boolean put(PageId pageId, byte[] page, CacheScope cacheScope, CacheQuota cacheQuota)
CacheManager
put
in interface CacheManager
pageId
- page identifierpage
- page datacacheScope
- scope of this requestcacheQuota
- cache quotapublic int get(PageId pageId, int bytesToRead, byte[] buffer, int offsetInBuffer)
CacheManager
get
in interface CacheManager
pageId
- 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)
CacheManager
get
in interface CacheManager
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 writepublic boolean delete(PageId pageId)
CacheManager
delete
in interface CacheManager
pageId
- page identifierpublic CacheManager.State state()
state
in interface CacheManager
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2023. All Rights Reserved.