Package io.trino.spi
Class PageBuilder
- java.lang.Object
-
- io.trino.spi.PageBuilder
-
public class PageBuilder extends Object
-
-
Constructor Summary
Constructors Constructor Description PageBuilder(int initialExpectedEntries, List<? extends Type> types)
PageBuilder(List<? extends Type> types)
Create a PageBuilder with given types.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Page
build()
void
declarePosition()
void
declarePositions(int positions)
BlockBuilder
getBlockBuilder(int channel)
int
getPositionCount()
long
getRetainedSizeInBytes()
long
getSizeInBytes()
Type
getType(int channel)
boolean
isEmpty()
boolean
isFull()
PageBuilder
newPageBuilderLike()
void
reset()
static PageBuilder
withMaxPageSize(int maxPageBytes, List<? extends Type> types)
-
-
-
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.
-
-
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()
-
-