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 |
aging()
Decrease each item's clock and clean stale items.
|
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 pageOffset,
int bytesToRead,
PageReadTargetBuffer target,
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,
ByteBuffer 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 |
updateWorkingSetSize()
Update working set size in number of pages and bytes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, get, get, getCachedPageIdsByFileId, invalidate, put, put, put
public CacheManagerWithShadowCache(CacheManager cacheManager, AlluxioConfiguration conf)
cacheManager
- the real cache managerconf
- the alluxio configurationpublic boolean put(PageId pageId, ByteBuffer page, CacheContext cacheContext)
CacheManager
put
in interface CacheManager
pageId
- page identifierpage
- page datacacheContext
- cache related contextpublic int get(PageId pageId, int pageOffset, int bytesToRead, PageReadTargetBuffer target, CacheContext cacheContext)
CacheManager
get
in interface CacheManager
pageId
- page identifierpageOffset
- offset into the pagebytesToRead
- number of bytes to read in this pagetarget
- destination buffer to writecacheContext
- cache related contextpublic void updateWorkingSetSize()
public boolean delete(PageId pageId)
CacheManager
delete
in interface CacheManager
pageId
- page identifierpublic void stopUpdate()
public CacheManager.State state()
state
in interface CacheManager
public boolean append(PageId pageId, int appendAt, byte[] page, CacheContext cacheContext)
append
in interface CacheManager
public void close() throws Exception
close
in interface AutoCloseable
Exception
public void aging()
public long getShadowCachePages()
public long getShadowCacheBytes()
public long getShadowCachePageRead()
public long getShadowCachePageHit()
public long getShadowCacheByteRead()
public long getShadowCacheByteHit()
Copyright © 2023. All Rights Reserved.