@InterfaceAudience.Private public class CachedBlock extends Object implements HeapSize, Comparable<CachedBlock>
LruBlockCache.
Makes the block memory-aware with HeapSize and Comparable
to sort by access time for the LRU. It also takes care of priority by
either instantiating as in-memory or handling the transition from single
to multiple access.
| Modifier and Type | Field and Description |
|---|---|
static long |
PER_BLOCK_OVERHEAD |
| Constructor and Description |
|---|
CachedBlock(BlockCacheKey cacheKey,
Cacheable buf,
long accessTime) |
CachedBlock(BlockCacheKey cacheKey,
Cacheable buf,
long accessTime,
boolean inMemory) |
| Modifier and Type | Method and Description |
|---|---|
void |
access(long accessTime)
Block has been accessed.
|
int |
compareTo(CachedBlock that) |
boolean |
equals(Object obj) |
Cacheable |
getBuffer() |
BlockCacheKey |
getCacheKey() |
org.apache.hadoop.hbase.io.hfile.CachedBlock.BlockPriority |
getPriority() |
long |
heapSize() |
public CachedBlock(BlockCacheKey cacheKey, Cacheable buf, long accessTime)
public CachedBlock(BlockCacheKey cacheKey, Cacheable buf, long accessTime, boolean inMemory)
public void access(long accessTime)
public int compareTo(CachedBlock that)
compareTo in interface Comparable<CachedBlock>public Cacheable getBuffer()
public BlockCacheKey getCacheKey()
public org.apache.hadoop.hbase.io.hfile.CachedBlock.BlockPriority getPriority()
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.