Package io.trino.operator.output
Class SlicePositionsAppender
java.lang.Object
io.trino.operator.output.SlicePositionsAppender
- All Implemented Interfaces:
PositionsAppender
-
Constructor Summary
ConstructorsConstructorDescriptionSlicePositionsAppender(int expectedEntries, int expectedBytes) SlicePositionsAppender(int expectedEntries, long maxPageSizeInBytes) -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends single position.voidvoidAppends 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.
-
Constructor Details
-
SlicePositionsAppender
public SlicePositionsAppender(int expectedEntries, long maxPageSizeInBytes) -
SlicePositionsAppender
public SlicePositionsAppender(int expectedEntries, int expectedBytes)
-
-
Method Details
-
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, Block)with positions 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, Block)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
-