public class CacheManagerWithShadowCache extends Object implements CacheManager
Modifier and Type | Class and Description |
---|---|
static class |
CacheManagerWithShadowCache.PageIdFunnel
Funnel for PageId.
|
CacheManager.Factory, CacheManager.State
Constructor and Description |
---|
CacheManagerWithShadowCache(CacheManager cacheManager,
AlluxioConfiguration conf) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
delete(PageId pageId)
Deletes a page from the cache.
|
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.
|
long |
getShadowCacheByteHit() |
long |
getShadowCacheByteRead() |
long |
getShadowCacheBytes() |
long |
getShadowCachePageHit() |
long |
getShadowCachePageRead() |
long |
getShadowCachePages() |
boolean |
put(PageId pageId,
byte[] page,
CacheContext cacheContext)
Puts a page into the cache manager with scope and quota respected.
|
CacheManager.State |
state() |
void |
stopUpdate()
Stop to switch bloom filters and update working set size.
|
void |
switchBloomFilter()
Replace the oldest bloom filter with a new one.
|
void |
updateWorkingSetSize()
Update working set size in number of pages and bytes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, get, put
public CacheManagerWithShadowCache(CacheManager cacheManager, AlluxioConfiguration conf)
cacheManager
- the real cache managerconf
- the alluxio configurationpublic void stopUpdate()
public void updateWorkingSetSize()
public boolean put(PageId pageId, byte[] page, CacheContext cacheContext)
CacheManager
put
in interface CacheManager
pageId
- page identifierpage
- page datacacheContext
- cache related contextpublic void switchBloomFilter()
public long getShadowCachePages()
public long getShadowCacheBytes()
public long getShadowCachePageRead()
public long getShadowCachePageHit()
public long getShadowCacheByteRead()
public long getShadowCacheByteHit()
public int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer, int offsetInBuffer, CacheContext cacheContext)
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 writecacheContext
- cache related contextpublic 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.