Package io.trino.operator.output
Interface PositionsAppender
- All Known Implementing Classes:
RowPositionsAppender
public interface PositionsAppender
-
Method Summary
Modifier and TypeMethodDescriptionvoidappend(int position, ValueBlock source) Appends single position.voidappend(it.unimi.dsi.fastutil.ints.IntArrayList positions, ValueBlock source) voidappendRle(ValueBlock value, int rlePositionCount) Appends the specified value positionCount times.build()Creates the block from the appender data.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
-
append
-
appendRle
Appends the specified value positionCount times. The result is the same as with usingappend(IntArrayList, ValueBlock)with a position list [0...positionCount -1] but with possible performance optimizations. -
append
Appends 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 ifappend(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. -
build
Block build()Creates the block from the appender data. After this, appender is reset to the initial state, and it is ready to build a new block. -
reset
void reset()Reset this appender without creating a block. -
getRetainedSizeInBytes
long getRetainedSizeInBytes()Returns number of bytes retained by this instance in memory including over-allocations. -
getSizeInBytes
long getSizeInBytes()Returns the size of memory in bytes used by this appender.
-