Interface HFileBlock.BlockIterator

Enclosing class:
HFileBlock

static interface HFileBlock.BlockIterator
Iterator for reading HFileBlocks in load-on-open-section, such as root data index block, meta index block, file info block etc.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Now we use the ByteBuffAllocator 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.
    Similar to nextBlock() 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 to nextBlock() but checks block type, throws an exception if incorrect, and returns the HFile block
      Throws:
      IOException
    • freeBlocks

      void freeBlocks()
      Now we use the ByteBuffAllocator 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 call freeBlocks() when closing the HFileReader. Sum bytes of those blocks in load-on-open section should be quite small, so tracking them should be OK.