Interface BlockBuilder

  • Method Details

    • getPositionCount

      int getPositionCount()
      Returns the number of positions in this block builder.
    • getSizeInBytes

      long getSizeInBytes()
      Returns the size of this block as if it was compacted, ignoring any over-allocations and any unloaded nested blocks. For example, in dictionary blocks, this only counts each dictionary entry once, rather than each time a value is referenced.
    • getRetainedSizeInBytes

      long getRetainedSizeInBytes()
      Returns the retained size of this block in memory, including over-allocations. This method is called from the innermost execution loop and must be fast.
    • append

      void append(ValueBlock block, int position)
      Append the specified value.
    • appendRepeated

      void appendRepeated(ValueBlock block, int position, int count)
      Append the specified value multiple times.
    • appendRange

      void appendRange(ValueBlock block, int offset, int length)
      Append the values in the specified range.
    • appendPositions

      void appendPositions(ValueBlock block, int[] positions, int offset, int length)
      Append the values at the specified positions.
    • appendNull

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

      void resetTo(int position)
      Rolls back added data to the specified position. Resetting may result in a block without nulls with the may-have-nulls flag set. The PageBuilder status will not be updated to reflect the removed data size.
      Throws:
      IllegalArgumentException - if the position is greater than the current position count
    • build

      Block build()
      Builds the block. This method can be called multiple times. The return value may be a block such as RLE to allow for optimizations when all block values are the same.
    • buildValueBlock

      ValueBlock buildValueBlock()
      Builds a ValueBlock. 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)