Class TestBucketCacheRefCnt.MyBucketCache2
java.lang.Object
org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
org.apache.hadoop.hbase.io.hfile.bucket.TestBucketCacheRefCnt.MyBucketCache2
- All Implemented Interfaces:
- Iterable<org.apache.hadoop.hbase.io.hfile.CachedBlock>,- org.apache.hadoop.hbase.io.HeapSize,- org.apache.hadoop.hbase.io.hfile.BlockCache
- Enclosing class:
- TestBucketCacheRefCnt
static class TestBucketCacheRefCnt.MyBucketCache2
extends org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheorg.apache.hadoop.hbase.io.hfile.bucket.BucketCache.RAMCache, org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.RAMQueueEntry, org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.WriterThread
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final AtomicIntegerprivate static final Stringprivate static final Stringprivate final CyclicBarrierprivate final AtomicIntegerprivate static final Stringprivate final CyclicBarrierprivate org.apache.hadoop.hbase.nio.ByteBuffprivate final CyclicBarrierprivate final AtomicIntegerprivate final CyclicBarrierThis is used forBucketCache.WriterThread,CACHE_BLOCK_THREAD_NAMEandEVICT_BLOCK_THREAD_NAME,waiting for caching block completed.Fields inherited from class org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheACCEPT_FACTOR_CONFIG_NAME, backingMap, blocksByHFile, 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, fullyCachedFiles, ioEngine, isCacheInconsistent, MEMORY_FACTOR_CONFIG_NAME, MIN_FACTOR_CONFIG_NAME, MULTI_FACTOR_CONFIG_NAME, offsetLock, ramCache, regionCachedSizeMap, SINGLE_FACTOR_CONFIG_NAME, writerQueues, writerThreads
- 
Constructor SummaryConstructorsConstructorDescriptionMyBucketCache2(String ioEngineName, long capacity, int blockSize, int[] bucketSizes, int writerThreadNum, int writerQLen, String persistencePath) 
- 
Method SummaryModifier and TypeMethodDescription(package private) voidblockEvicted(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey, org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry, boolean decrementBlockNumber, boolean evictedByEvictionProcess) (package private) voiddoDrain(List<org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.RAMQueueEntry> entries, ByteBuffer metaBuff) (package private) voidfreeBucketEntry(org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry) Overwrite 0xff to theBucketEntrycontent to simulate it would be overwrite after theBucketEntryis freed.org.apache.hadoop.hbase.io.hfile.CacheablegetBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey key, boolean caching, boolean repeat, boolean updateCacheMetrics) protected voidputIntoBackingMap(org.apache.hadoop.hbase.io.hfile.BlockCacheKey key, org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry) protected booleanremoveFromRamCache(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey) Methods inherited from class org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheacceptableSize, blockFitsIntoTheCache, cacheBlock, cacheBlock, cacheBlock, cacheBlockWithWait, cacheBlockWithWaitInternal, evictBlock, evictBlockIfNoRpcReferenced, evictBlocksByHfileName, evictBucketEntryIfNoRpcReferenced, fileCacheCompleted, finalize, freeSpace, getAcceptableFactor, getAlgorithm, getAllocator, getBackingMap, getBackingMapValidated, getBlockCaches, getBlockCount, getBlockSize, getBucketCacheFromCacheConfig, getCurrentDataSize, getCurrentSize, getDataBlockCount, getExtraFreeFactor, getFreeSize, getFullyCachedFiles, getIoEngine, getMaxSize, getMemoryFactor, getMinFactor, getMultiFactor, getPartitionSize, getPersistencePath, getRAMQueueEntries, getRealCacheSize, getRegionCachedInfo, getRpcRefCount, getSingleFactor, getStats, heapSize, isAlreadyCached, isCacheEnabled, isCacheInconsistent, isCachePersistenceEnabled, isCachePersistent, iterator, logStats, notifyFileBlockEvicted, notifyFileCachingCompleted, persistToFile, setCacheInconsistent, shouldCacheFile, shouldReplaceExistingCacheBlock, shutdown, size, startBucketCachePersisterThread, startWriterThreads, stopWriterThreadsMethods inherited from class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.io.hfile.BlockCacheisMetaBlockMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
GET_BLOCK_THREAD_NAME- See Also:
 
- 
CACHE_BLOCK_THREAD_NAME- See Also:
 
- 
EVICT_BLOCK_THREAD_NAME- See Also:
 
- 
getCyclicBarrier
- 
evictCyclicBarrier
- 
putCyclicBarrier
- 
writeThreadDoneCyclicBarrierThis is used forBucketCache.WriterThread,CACHE_BLOCK_THREAD_NAMEandEVICT_BLOCK_THREAD_NAME,waiting for caching block completed.
- 
blockEvictCounter
- 
removeRamCounter
- 
freeBucketEntryCounter
- 
overwiteByteBuff
 
- 
- 
Constructor Details- 
MyBucketCache2public MyBucketCache2(String ioEngineName, long capacity, int blockSize, int[] bucketSizes, int writerThreadNum, int writerQLen, String persistencePath) throws IOException - Throws:
- IOException
 
 
- 
- 
Method Details- 
putIntoBackingMapprotected void putIntoBackingMap(org.apache.hadoop.hbase.io.hfile.BlockCacheKey key, org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry) - Overrides:
- putIntoBackingMapin class- org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
 
- 
doDrainvoid doDrain(List<org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.RAMQueueEntry> entries, ByteBuffer metaBuff) throws InterruptedException - Overrides:
- doDrainin class- org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
- Throws:
- InterruptedException
 
- 
getBlockpublic org.apache.hadoop.hbase.io.hfile.Cacheable getBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey key, boolean caching, boolean repeat, boolean updateCacheMetrics) - Specified by:
- getBlockin interface- org.apache.hadoop.hbase.io.hfile.BlockCache
- Overrides:
- getBlockin class- org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
 
- 
removeFromRamCache- Overrides:
- removeFromRamCachein class- org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
 
- 
blockEvictedvoid blockEvicted(org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey, org.apache.hadoop.hbase.io.hfile.bucket.BucketEntry bucketEntry, boolean decrementBlockNumber, boolean evictedByEvictionProcess) - Overrides:
- blockEvictedin class- org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
 
- 
freeBucketEntryOverwrite 0xff to theBucketEntrycontent to simulate it would be overwrite after theBucketEntryis freed.- Overrides:
- freeBucketEntryin class- org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
 
 
-