static class TestBucketCacheRefCnt.MyBucketCache2 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 static String |
EVICT_BLOCK_THREAD_NAME |
private CyclicBarrier |
evictCyclicBarrier |
private AtomicInteger |
freeBucketEntryCounter |
private static String |
GET_BLOCK_THREAD_NAME |
private CyclicBarrier |
getCyclicBarrier |
private org.apache.hadoop.hbase.nio.ByteBuff |
overwiteByteBuff |
private CyclicBarrier |
putCyclicBarrier |
private AtomicInteger |
removeRamCounter |
private CyclicBarrier |
writeThreadDoneCyclicBarrier
This is used for
BucketCache.WriterThread ,CACHE_BLOCK_THREAD_NAME and
EVICT_BLOCK_THREAD_NAME ,waiting for caching block completed. |
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 |
---|
MyBucketCache2(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) |
(package private) void |
doDrain(List<org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.RAMQueueEntry> entries,
ByteBuffer metaBuff) |
(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 void |
putIntoBackingMap(org.apache.hadoop.hbase.io.hfile.BlockCacheKey key,
org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry) |
protected boolean |
removeFromRamCache(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey) |
acceptableSize, cacheBlock, cacheBlock, cacheBlockWithWait, cacheBlockWithWaitInternal, 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, shouldReplaceExistingCacheBlock, shutdown, size, startWriterThreads, stopWriterThreads
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
private static final String GET_BLOCK_THREAD_NAME
private static final String CACHE_BLOCK_THREAD_NAME
private static final String EVICT_BLOCK_THREAD_NAME
private final CyclicBarrier getCyclicBarrier
private final CyclicBarrier evictCyclicBarrier
private final CyclicBarrier putCyclicBarrier
private final CyclicBarrier writeThreadDoneCyclicBarrier
BucketCache.WriterThread
,CACHE_BLOCK_THREAD_NAME
and
EVICT_BLOCK_THREAD_NAME
,waiting for caching block completed.private final AtomicInteger blockEvictCounter
private final AtomicInteger removeRamCounter
private final AtomicInteger freeBucketEntryCounter
private org.apache.hadoop.hbase.nio.ByteBuff overwiteByteBuff
public MyBucketCache2(String ioEngineName, long capacity, int blockSize, int[] bucketSizes, int writerThreadNum, int writerQLen, String persistencePath) throws IOException
IOException
protected void putIntoBackingMap(org.apache.hadoop.hbase.io.hfile.BlockCacheKey key, org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry)
putIntoBackingMap
in class org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
void doDrain(List<org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.RAMQueueEntry> entries, ByteBuffer metaBuff) throws InterruptedException
doDrain
in class org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
InterruptedException
public 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.BlockCache
getBlock
in class org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
protected boolean removeFromRamCache(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey)
removeFromRamCache
in class org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
void 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.BucketCache
void 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.BucketCache
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.