Package org.apache.hadoop.hbase.io.hfile
Interface HFileBlock.BlockIterator
- Enclosing class:
- HFileBlock
static interface HFileBlock.BlockIterator
Iterator for reading
HFileBlock
s in load-on-open-section, such as root data index
block, meta index block, file info block etc.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Now we use theByteBuffAllocator
to manage the nio ByteBuffers for HFileBlocks, so we must deallocate all of the ByteBuffers in the end life.Get the next block, or null if there are no more blocks to iterate.nextBlockWithBlockType
(BlockType blockType) Similar tonextBlock()
but checks block type, throws an exception if incorrect, and returns the HFile block
-
Method Details
-
nextBlock
Get the next block, or null if there are no more blocks to iterate.- Throws:
IOException
-
nextBlockWithBlockType
Similar tonextBlock()
but checks block type, throws an exception if incorrect, and returns the HFile block- Throws:
IOException
-
freeBlocks
void freeBlocks()Now we use theByteBuffAllocator
to manage the nio ByteBuffers for HFileBlocks, so we must deallocate all of the ByteBuffers in the end life. the BlockIterator's life cycle is starting from opening an HFileReader and stopped when the HFileReader#close, so we will keep track all the read blocks until we callfreeBlocks()
when closing the HFileReader. Sum bytes of those blocks in load-on-open section should be quite small, so tracking them should be OK.
-