Interface BlockBuilder

All Superinterfaces:
Block
All Known Implementing Classes:
ArrayBlockBuilder, ByteArrayBlockBuilder, Fixed12BlockBuilder, Int128ArrayBlockBuilder, IntArrayBlockBuilder, LongArrayBlockBuilder, MapBlockBuilder, RowBlockBuilder, ShortArrayBlockBuilder, SingleArrayBlockWriter, SingleMapBlockWriter, SingleRowBlockWriter, VariableWidthBlockBuilder

public interface BlockBuilder extends Block
  • Method Details

    • writeByte

      default BlockBuilder writeByte(int value)
      Write a byte to the current entry;
    • writeShort

      default BlockBuilder writeShort(int value)
      Write a short to the current entry;
    • writeInt

      default BlockBuilder writeInt(int value)
      Write a int to the current entry;
    • writeLong

      default BlockBuilder writeLong(long value)
      Write a long to the current entry;
    • writeBytes

      default BlockBuilder writeBytes(io.airlift.slice.Slice source, int sourceIndex, int length)
      Write a byte sequences to the current entry;
    • beginBlockEntry

      default BlockBuilder beginBlockEntry()
      Return a writer to the current entry. The caller can operate on the returned caller to incrementally build the object. This is generally more efficient than building the object elsewhere and call writeObject afterwards because a large chunk of memory could potentially be unnecessarily copied in this process.
    • getPositions

      default Block getPositions(int[] visiblePositions, int offset, int length)
      Create a new block from the current materialized block by keeping the same elements only with respect to visiblePositions.
      Specified by:
      getPositions in interface Block
    • closeEntry

      BlockBuilder closeEntry()
      Close the current entry.
    • appendNull

      BlockBuilder appendNull()
      Appends a null value to the block.
    • build

      Block build()
      Builds the block. This method can be called multiple times.
    • newBlockBuilderLike

      BlockBuilder newBlockBuilderLike(int expectedEntries, BlockBuilderStatus blockBuilderStatus)
      Creates a new block builder of the same type based on the current usage statistics of this block builder.
    • newBlockBuilderLike

      default BlockBuilder newBlockBuilderLike(BlockBuilderStatus blockBuilderStatus)
    • copyWithAppendedNull

      default Block copyWithAppendedNull()
      This method is not expected to be implemented for BlockBuilder implementations, the method appendNull() should be used instead.
      Specified by:
      copyWithAppendedNull in interface Block