public static interface HFile.CachingBlockReader
Modifier and Type | Method and Description |
---|---|
HFileBlock |
readBlock(long offset,
long onDiskBlockSize,
boolean cacheBlock,
boolean pread,
boolean isCompaction,
boolean updateCacheMetrics,
BlockType expectedBlockType,
DataBlockEncoding expectedDataBlockEncoding)
Read in a file block.
|
void |
returnBlock(HFileBlock block)
Return the given block back to the cache, if it was obtained from cache.
|
HFileBlock readBlock(long offset, long onDiskBlockSize, boolean cacheBlock, boolean pread, boolean isCompaction, boolean updateCacheMetrics, BlockType expectedBlockType, DataBlockEncoding expectedDataBlockEncoding) throws IOException
offset
- offset to read.onDiskBlockSize
- size of the blockcacheBlock
- pread
- isCompaction
- is this block being read as part of a compactionexpectedBlockType
- the block type we are expecting to read with this read operation,
or null to read whatever block type is available and avoid checking (that might reduce
caching efficiency of encoded data blocks)expectedDataBlockEncoding
- the data block encoding the caller is expecting data blocks
to be in, or null to not perform this check and return the block irrespective of the
encoding. This check only applies to data blocks and can be set to null when the caller is
expecting to read a non-data block and has set expectedBlockType accordingly.IOException
void returnBlock(HFileBlock block)
block
- Block to be returned.Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.