Package org.apache.hadoop.hbase.io.hfile
package org.apache.hadoop.hbase.io.hfile
Provides implementations of Enabling
See the HBase Reference Guide Enable BucketCache.
HFile
and HFile
BlockCache
. Caches are configured (and instantiated)
by CacheConfig
. See head of the
CacheConfig
class for constants that define
cache options and configuration keys to use setting cache options. Cache implementations
include the default, native on-heap LruBlockCache
and a
BucketCache
that has a bunch of deploy formats
including acting as a L2 for LruBlockCache -- when a block is evicted from LruBlockCache, it
goes to the BucketCache and when we search a block, we look in both places -- or, the
most common deploy type,
using CombinedBlockCache
, BucketCache is used as
a host for data blocks with meta blocks in an instance of LruBlockCache. BucketCache
can also be onheap, offheap, and file-backed.
Which BlockCache should I use?
By default LruBlockCache is on. If you would like to cache more, and offheap (offheap usually means less GC headache), try enabling * BucketCache. Fetching will always be slower when fetching from BucketCache but latencies tend to be less erratic over time (roughly because GC is less). See Nick Dimiduk's BlockCache 101 for some numbers.Enabling BucketCache
See the HBase Reference Guide Enable BucketCache.-
ClassDescriptionorg.apache.hadoop.hbase.io.hfile.AgeSnapshotSnapshot of block cache age in cache.org.apache.hadoop.hbase.io.hfile.BlockCacheBlock cache interface.org.apache.hadoop.hbase.io.hfile.BlockCacheFactoryorg.apache.hadoop.hbase.io.hfile.BlockCacheKeyCache Key for use with implementations of
BlockCache
org.apache.hadoop.hbase.io.hfile.BlockCacheUtilUtilty for aggregating counts in CachedBlocks and toString/toJSON CachedBlocks and BlockCaches.org.apache.hadoop.hbase.io.hfile.BlockCacheUtil.CachedBlocksByFileUse one of these to keep a running account of cached blocks by file.org.apache.hadoop.hbase.io.hfile.BlockCompressedSizePredicatorAllows for defining different compression rate predicates on its implementing classes.org.apache.hadoop.hbase.io.hfile.BlockIndexChunkorg.apache.hadoop.hbase.io.hfile.BlockPriorityorg.apache.hadoop.hbase.io.hfile.BlockTypeVarious types of HFile blocks.org.apache.hadoop.hbase.io.hfile.BlockType.BlockCategoryorg.apache.hadoop.hbase.io.hfile.BlockWithScanInfoBlockWithScanInfo is wrapper class for HFileBlock with other attributes.org.apache.hadoop.hbase.io.hfile.BloomFilterMetricsorg.apache.hadoop.hbase.io.hfile.CacheableCacheable is an interface that allows for an object to be cached.org.apache.hadoop.hbase.io.hfile.CacheableDeserializer<T extends org.apache.hadoop.hbase.io.hfile.Cacheable>Interface for a deserializer.org.apache.hadoop.hbase.io.hfile.CacheableDeserializerIdManagerThis class is used to manage the identifiers forCacheableDeserializer
.org.apache.hadoop.hbase.io.hfile.CacheConfigStores all of the cache objects and configuration for a single HFile.org.apache.hadoop.hbase.io.hfile.CachedBlockorg.apache.hadoop.hbase.io.hfile.CacheStatsClass that implements cache metrics.org.apache.hadoop.hbase.io.hfile.ChecksumUtilUtility methods to compute and validate checksums.org.apache.hadoop.hbase.io.hfile.CombinedBlockCacheCombinedBlockCache is an abstraction layer that combinesFirstLevelBlockCache
andBucketCache
.org.apache.hadoop.hbase.io.hfile.CombinedBlockCache.CombinedCacheStatsorg.apache.hadoop.hbase.io.hfile.CompoundBloomFilterA Bloom filter implementation built on top ofBloomFilterChunk
, encapsulating a set of fixed-size Bloom filters written out at the time ofHFile
generation into the data block stream, and loaded on demand at query time.org.apache.hadoop.hbase.io.hfile.CompoundBloomFilterBaseorg.apache.hadoop.hbase.io.hfile.CompoundBloomFilterWriterAdds methods required for writing a compound Bloom filter to the data section of anHFile
to theCompoundBloomFilter
class.org.apache.hadoop.hbase.io.hfile.CorruptHFileExceptionThis exception is thrown when attempts to read an HFile fail due to corruption or truncation issues.org.apache.hadoop.hbase.io.hfile.ExclusiveMemHFileBlockTheByteBuffAllocator
won't allocate pooled heapByteBuff
now; at the same time, if allocate an off-heapByteBuff
from allocator, then it must be a pooled one.org.apache.hadoop.hbase.io.hfile.FirstLevelBlockCacheIn-memory BlockCache that may be backed by secondary layer(s).org.apache.hadoop.hbase.io.hfile.FixedFileTrailerTheHFile
has a fixed trailer which contains offsets to other variable parts of the file.org.apache.hadoop.hbase.io.hfile.HFileFile format for hbase.org.apache.hadoop.hbase.io.hfile.HFile.CachingBlockReaderAn abstraction used by the block index.org.apache.hadoop.hbase.io.hfile.HFile.ReaderAn interface used by clients to open and iterate anHFile
.org.apache.hadoop.hbase.io.hfile.HFile.WriterAPI required to write anHFile
org.apache.hadoop.hbase.io.hfile.HFile.WriterFactoryThis variety of ways to construct writers is used throughout the code, and we want to be able to swap writer implementations.org.apache.hadoop.hbase.io.hfile.HFileBlockCacheable Blocks of anHFile
version 2 file.org.apache.hadoop.hbase.io.hfile.HFileBlock.BlockDeserializerorg.apache.hadoop.hbase.io.hfile.HFileBlockBuilderorg.apache.hadoop.hbase.io.hfile.HFileBlockIndexProvides functionality to write (HFileBlockIndex.BlockIndexWriter
) and read BlockIndexReader single-level and multi-level block indexes.org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.BlockIndexWriterWrites the block index into the output stream.org.apache.hadoop.hbase.io.hfile.HFileContextRead-only HFile Context Information.org.apache.hadoop.hbase.io.hfile.HFileContextBuilderA builder that helps in building up the HFileContextorg.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoderControls what kind of data block encoding is used.org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoderImplDo different kinds of data block encoding according to column family options.org.apache.hadoop.hbase.io.hfile.HFileIndexBlockEncoderControls what kind of index block encoding is used.org.apache.hadoop.hbase.io.hfile.HFileIndexBlockEncoder.EncodedSeekerorg.apache.hadoop.hbase.io.hfile.HFileIndexBlockEncoderImplDo different kinds of index block encoding according to column family options.org.apache.hadoop.hbase.io.hfile.HFileInfoMetadata Map of attributes for HFile written out as HFile Trailer.org.apache.hadoop.hbase.io.hfile.HFilePreadReaderImplementation ofHFile.Reader
to deal with pread.org.apache.hadoop.hbase.io.hfile.HFilePrettyPrinterImplements pretty-printing functionality forHFile
s.org.apache.hadoop.hbase.io.hfile.HFileReaderImplImplementation that can handle all hfile versions ofHFile.Reader
.org.apache.hadoop.hbase.io.hfile.HFileReaderImpl.BlockIndexNotLoadedExceptionorg.apache.hadoop.hbase.io.hfile.HFileReaderImpl.EncodedScannerScanner that operates on encoded data blocks.org.apache.hadoop.hbase.io.hfile.HFileReaderImpl.HFileScannerImplorg.apache.hadoop.hbase.io.hfile.HFileReaderImpl.NotSeekedExceptionAn exception thrown when an operation requiring a scanner to be seeked is invoked on a scanner that is not seeked.org.apache.hadoop.hbase.io.hfile.HFileScannerA scanner allows you to position yourself within a HFile and scan through it.org.apache.hadoop.hbase.io.hfile.HFileStreamReaderImplementation ofHFile.Reader
to deal with stream read do not perform any prefetch operations (HFilePreadReader will do this).org.apache.hadoop.hbase.io.hfile.HFileWriterImplCommon functionality needed by all versions ofHFile
writers.org.apache.hadoop.hbase.io.hfile.InclusiveCombinedBlockCacheorg.apache.hadoop.hbase.io.hfile.IndexOnlyLruBlockCacheAn on heap block cache implementation extended LruBlockCache and only cache index block.org.apache.hadoop.hbase.io.hfile.InlineBlockWriterA way to write "inline" blocks into anHFile
.org.apache.hadoop.hbase.io.hfile.InvalidHFileExceptionThrown when an invalid HFile format is detectedorg.apache.hadoop.hbase.io.hfile.LruAdaptiveBlockCacheThis realisation improve performance of classical LRU cache up to 3 times via reduce GC job.org.apache.hadoop.hbase.io.hfile.LruBlockCacheA block cache implementation that is memory-aware usingHeapSize
, memory-bound using an LRU eviction algorithm, and concurrent: backed by aConcurrentHashMap
and with a non-blocking eviction thread giving constant-timeLruBlockCache.cacheBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey, org.apache.hadoop.hbase.io.hfile.Cacheable, boolean)
andLruBlockCache.getBlock(org.apache.hadoop.hbase.io.hfile.BlockCacheKey, boolean, boolean, boolean)
operations.org.apache.hadoop.hbase.io.hfile.LruCachedBlockRepresents an entry in theLruBlockCache
.org.apache.hadoop.hbase.io.hfile.LruCachedBlockQueueA memory-bound queue that will grow until an element brings total size >= maxSize.org.apache.hadoop.hbase.io.hfile.MemcachedBlockCacheClass to store blocks into memcached.org.apache.hadoop.hbase.io.hfile.NoOpDataBlockEncoderDoes not perform any kind of encoding/decoding.org.apache.hadoop.hbase.io.hfile.NoOpIndexBlockEncoderDoes not perform any kind of encoding/decoding.org.apache.hadoop.hbase.io.hfile.NoOpIndexBlockEncoder.NoOpEncodedSeekerorg.apache.hadoop.hbase.io.hfile.PrefetchExecutororg.apache.hadoop.hbase.io.hfile.PreviousBlockCompressionRatePredicatorThis BlockCompressedSizePredicator implementation adjusts the block size limit based on the compression rate of the block contents read so far.org.apache.hadoop.hbase.io.hfile.ReaderContextCarries the information on some of the meta data about the HFile Readerorg.apache.hadoop.hbase.io.hfile.ReaderContext.ReaderTypeorg.apache.hadoop.hbase.io.hfile.ReaderContextBuilderA builder that helps in building up the ReaderContextorg.apache.hadoop.hbase.io.hfile.ResizableBlockCacheBlockCache which is resizable.org.apache.hadoop.hbase.io.hfile.SharedMemHFileBlockTheByteBuffAllocator
won't allocate pooled heapByteBuff
now; at the same time, if allocate an off-heapByteBuff
from allocator, then it must be a pooled one.org.apache.hadoop.hbase.io.hfile.TinyLfuBlockCacheA block cache that is memory-aware usingHeapSize
, memory bounded using the W-TinyLFU eviction algorithm, and concurrent.org.apache.hadoop.hbase.io.hfile.UncompressedBlockSizePredicatorThis BlockCompressedSizePredicator implementation doesn't actually performs any predicate and simply returns true onshouldFinishBlock
.