Class PageBuilder

java.lang.Object
io.trino.spi.PageBuilder

public class PageBuilder extends Object
  • Constructor Details

    • PageBuilder

      public PageBuilder(List<? extends Type> types)
      Create a PageBuilder with given types.

      A PageBuilder instance created with this constructor has no estimation about bytes per entry, therefore it can resize frequently while appending new rows.

      This constructor should only be used to get the initial PageBuilder. Once the PageBuilder is full use reset() or newPageBuilderLike() to create a new PageBuilder instance with its size estimated based on previous data.

    • PageBuilder

      public PageBuilder(int initialExpectedEntries, List<? extends Type> types)
  • Method Details

    • withMaxPageSize

      public static PageBuilder withMaxPageSize(int maxPageBytes, List<? extends Type> types)
    • reset

      public void reset()
    • getBlockBuilder

      public BlockBuilder getBlockBuilder(int channel)
    • declarePosition

      public void declarePosition()
    • declarePositions

      public void declarePositions(int positions)
    • isFull

      public boolean isFull()
    • isEmpty

      public boolean isEmpty()
    • getPositionCount

      public int getPositionCount()
    • getSizeInBytes

      public long getSizeInBytes()
    • getRetainedSizeInBytes

      public long getRetainedSizeInBytes()
    • build

      public Page build()