Package io.trino.operator.output
Class RowPositionsAppender
java.lang.Object
io.trino.operator.output.RowPositionsAppender
- All Implemented Interfaces:
PositionsAppender
-
Method Summary
Modifier and TypeMethodDescriptionvoidappend(int position, ValueBlock value) Appends single position.voidappend(it.unimi.dsi.fastutil.ints.IntArrayList positions, ValueBlock block) voidappendRle(ValueBlock value, int rlePositionCount) Appends the specified value positionCount times.build()Creates the block from the appender data.static RowPositionsAppendercreateRowAppender(PositionsAppenderFactory positionsAppenderFactory, RowType type, int expectedPositions, long maxPageSizeInBytes) longReturns number of bytes retained by this instance in memory including over-allocations.longReturns the size of memory in bytes used by this appender.voidreset()Reset this appender without creating a block.
-
Method Details
-
createRowAppender
public static RowPositionsAppender createRowAppender(PositionsAppenderFactory positionsAppenderFactory, RowType type, int expectedPositions, long maxPageSizeInBytes) -
append
- Specified by:
appendin interfacePositionsAppender
-
appendRle
Description copied from interface:PositionsAppenderAppends the specified value positionCount times. The result is the same as with usingPositionsAppender.append(IntArrayList, ValueBlock)with a position list [0...positionCount -1] but with possible performance optimizations.- Specified by:
appendRlein interfacePositionsAppender
-
append
Description copied from interface:PositionsAppenderAppends single position. The implementation must be conceptually equal toappend(IntArrayList.wrap(new int[] {position}), source)but may be optimized. Caller should avoid using this method ifPositionsAppender.append(IntArrayList, ValueBlock)can be used as appending positions one by one can be significantly slower and may not support features like pushing RLE through the appender.- Specified by:
appendin interfacePositionsAppender
-
build
Description copied from interface:PositionsAppenderCreates the block from the appender data. After this, appender is reset to the initial state, and it is ready to build a new block.- Specified by:
buildin interfacePositionsAppender
-
getRetainedSizeInBytes
public long getRetainedSizeInBytes()Description copied from interface:PositionsAppenderReturns number of bytes retained by this instance in memory including over-allocations.- Specified by:
getRetainedSizeInBytesin interfacePositionsAppender
-
getSizeInBytes
public long getSizeInBytes()Description copied from interface:PositionsAppenderReturns the size of memory in bytes used by this appender.- Specified by:
getSizeInBytesin interfacePositionsAppender
-
reset
public void reset()Description copied from interface:PositionsAppenderReset this appender without creating a block.- Specified by:
resetin interfacePositionsAppender
-