Interface InlineBlockWriter

All Known Implementing Classes:
CompoundBloomFilterWriter, HFileBlockIndex.BlockIndexWriter

@Private public interface InlineBlockWriter
A way to write "inline" blocks into an HFile. Inline blocks are interspersed with data blocks. For example, Bloom filter chunks and leaf-level blocks of a multi-level block index are stored as inline blocks.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    blockWritten(long offset, int onDiskSize, int uncompressedSize)
    Called after a block has been written, and its offset, raw size, and compressed size have been determined.
    boolean
    Returns true if inline blocks produced by this writer should be cached
    The type of blocks this block writer produces.
    boolean
    shouldWriteBlock(boolean closing)
    Determines whether there is a new block to be written out.
    void
    Writes the block to the provided stream.
  • Method Details

    • shouldWriteBlock

      boolean shouldWriteBlock(boolean closing)
      Determines whether there is a new block to be written out. whether the file is being closed, in which case we need to write out all available data and not wait to accumulate another block
    • writeInlineBlock

      Writes the block to the provided stream. Must not write any magic records. Called only if shouldWriteBlock(boolean) returned true. a stream (usually a compressing stream) to write the block to
      Throws:
      IOException
    • blockWritten

      void blockWritten(long offset, int onDiskSize, int uncompressedSize)
      Called after a block has been written, and its offset, raw size, and compressed size have been determined. Can be used to add an entry to a block index. If this type of inline blocks needs a block index, the inline block writer is responsible for maintaining it.
      Parameters:
      offset - the offset of the block in the stream
      onDiskSize - the on-disk size of the block
      uncompressedSize - the uncompressed size of the block
    • getInlineBlockType

      The type of blocks this block writer produces.
    • getCacheOnWrite

      boolean getCacheOnWrite()
      Returns true if inline blocks produced by this writer should be cached