Package io.trino.spi

Class PageBuilder


  • public class PageBuilder
    extends Object
    • Constructor Detail

      • 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 createPageBuilderLike() to create a new PageBuilder instance with its size estimated based on previous data.

      • PageBuilder

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

      • withMaxPageSize

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

        public void reset()
      • newPageBuilderLike

        public PageBuilder newPageBuilderLike()
      • getBlockBuilder

        public BlockBuilder getBlockBuilder​(int channel)
      • getType

        public Type getType​(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()