static class TestBucketCacheRefCnt.MyBucketCache extends org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
| Modifier and Type | Field and Description |
|---|---|
private AtomicInteger |
blockEvictCounter |
private static String |
CACHE_BLOCK_THREAD_NAME |
private CyclicBarrier |
cyclicBarrier |
private AtomicInteger |
freeBucketEntryCounter |
private static String |
GET_BLOCK_THREAD_NAME |
private org.apache.hadoop.hbase.nio.ByteBuff |
overwiteByteBuff |
private AtomicInteger |
replaceCounter |
ACCEPT_FACTOR_CONFIG_NAME, backingMap, DEFAULT_ERROR_TOLERATION_DURATION, DEFAULT_MEMORY_FACTOR, DEFAULT_MIN_FACTOR, DEFAULT_MULTI_FACTOR, DEFAULT_SINGLE_FACTOR, DEFAULT_WRITER_QUEUE_ITEMS, DEFAULT_WRITER_THREADS, EXTRA_FREE_FACTOR_CONFIG_NAME, ioEngine, MEMORY_FACTOR_CONFIG_NAME, MIN_FACTOR_CONFIG_NAME, MULTI_FACTOR_CONFIG_NAME, offsetLock, ramCache, SINGLE_FACTOR_CONFIG_NAME, wait_when_cache, writerQueues, writerThreads| Constructor and Description |
|---|
MyBucketCache(String ioEngineName,
long capacity,
int blockSize,
int[] bucketSizes,
int writerThreadNum,
int writerQLen,
String persistencePath) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
blockEvicted(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey,
org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry,
boolean decrementBlockNumber,
boolean evictedByEvictionProcess) |
protected void |
cacheBlockWithWaitInternal(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey,
org.apache.hadoop.hbase.io.hfile.Cacheable cachedItem,
boolean inMemory,
boolean wait) |
(package private) void |
freeBucketEntry(org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry)
Overwrite 0xff to the
BucketEntry content to simulate it would be overwrite after the
BucketEntry is freed. |
org.apache.hadoop.hbase.io.hfile.Cacheable |
getBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey key,
boolean caching,
boolean repeat,
boolean updateCacheMetrics) |
protected boolean |
shouldReplaceExistingCacheBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey,
org.apache.hadoop.hbase.io.hfile.Cacheable newBlock)
Simulate the Block could be replaced.
|
acceptableSize, cacheBlock, cacheBlock, cacheBlockWithWait, doDrain, evictBlock, evictBlockIfNoRpcReferenced, evictBlocksByHfileName, evictBucketEntryIfNoRpcReferenced, freeSpace, getAcceptableFactor, getAlgorithm, getAllocator, getBlockCaches, getBlockCount, getCurrentDataSize, getCurrentSize, getDataBlockCount, getExtraFreeFactor, getFreeSize, getIoEngine, getMaxSize, getMemoryFactor, getMinFactor, getMultiFactor, getPartitionSize, getRAMQueueEntries, getRealCacheSize, getRpcRefCount, getSingleFactor, getStats, heapSize, isCacheEnabled, iterator, logStats, putIntoBackingMap, removeFromRamCache, shutdown, size, startWriterThreads, stopWriterThreadsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprivate static final String GET_BLOCK_THREAD_NAME
private static final String CACHE_BLOCK_THREAD_NAME
private final CyclicBarrier cyclicBarrier
private final AtomicInteger replaceCounter
private final AtomicInteger blockEvictCounter
private final AtomicInteger freeBucketEntryCounter
private org.apache.hadoop.hbase.nio.ByteBuff overwiteByteBuff
public MyBucketCache(String ioEngineName, long capacity, int blockSize, int[] bucketSizes, int writerThreadNum, int writerQLen, String persistencePath) throws IOException
IOExceptionprotected boolean shouldReplaceExistingCacheBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey, org.apache.hadoop.hbase.io.hfile.Cacheable newBlock)
shouldReplaceExistingCacheBlock in class org.apache.hadoop.hbase.io.hfile.bucket.BucketCachepublic org.apache.hadoop.hbase.io.hfile.Cacheable getBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey key, boolean caching, boolean repeat, boolean updateCacheMetrics)
getBlock in interface org.apache.hadoop.hbase.io.hfile.BlockCachegetBlock in class org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheprotected void cacheBlockWithWaitInternal(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey, org.apache.hadoop.hbase.io.hfile.Cacheable cachedItem, boolean inMemory, boolean wait)
cacheBlockWithWaitInternal in class org.apache.hadoop.hbase.io.hfile.bucket.BucketCachevoid blockEvicted(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey, org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry, boolean decrementBlockNumber, boolean evictedByEvictionProcess)
blockEvicted in class org.apache.hadoop.hbase.io.hfile.bucket.BucketCachevoid freeBucketEntry(org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry)
BucketEntry content to simulate it would be overwrite after the
BucketEntry is freed.freeBucketEntry in class org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.