public class ArrayBlockBuilder extends AbstractArrayBlock implements BlockBuilder
AbstractArrayBlock.ArrayBlockFunction<T>| Constructor and Description |
|---|
ArrayBlockBuilder(BlockBuilder valuesBlock,
BlockBuilderStatus blockBuilderStatus,
int expectedEntries)
Caller of this constructor is responsible for making sure `valuesBlock` is constructed with the same `blockBuilderStatus` as the one in the argument
|
ArrayBlockBuilder(Type elementType,
BlockBuilderStatus blockBuilderStatus,
int expectedEntries) |
ArrayBlockBuilder(Type elementType,
BlockBuilderStatus blockBuilderStatus,
int expectedEntries,
int expectedBytesPerEntry) |
| Modifier and Type | Method and Description |
|---|---|
BlockBuilder |
appendNull()
Appends a null value to the block.
|
BlockBuilder |
appendStructure(Block block)
Append a struct to the block and close the entry.
|
BlockBuilder |
appendStructureInternal(Block block,
int position)
Do not use this interface outside block package.
|
SingleArrayBlockWriter |
beginBlockEntry()
Return a writer to the current entry.
|
ArrayBlock |
build()
Builds the block.
|
BlockBuilder |
closeEntry()
Write a byte to the current entry;
|
protected int |
getOffsetBase() |
protected int[] |
getOffsets() |
int |
getPositionCount()
Returns the number of positions in this block.
|
protected Block |
getRawElementBlock() |
long |
getRetainedSizeInBytes()
Returns the retained size of this block in memory, including over-allocations.
|
long |
getSizeInBytes()
Returns the size of this block as if it was compacted, ignoring any over-allocations.
|
protected boolean[] |
getValueIsNull() |
BlockBuilder |
newBlockBuilderLike(BlockBuilderStatus blockBuilderStatus)
Creates a new block builder of the same type based on the current usage statistics of this block builder.
|
void |
retainedBytesForEachPart(BiConsumer<Object,Long> consumer)
consumer visits each of the internal data container and accepts the size for it. |
String |
toString() |
apply, copyPositions, copyRegion, getEncodingName, getEstimatedDataSizeForStats, getObject, getPositionsSizeInBytes, getRegion, getRegionSizeInBytes, getSingleValueBlock, isNull, mayHaveNull, writePositionToclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPositions, writeByte, writeBytes, writeInt, writeLong, writeShortbytesCompare, bytesEqual, compareTo, copyPositions, copyRegion, equals, getByte, getEncodingName, getEstimatedDataSizeForStats, getInt, getLoadedBlock, getLogicalSizeInBytes, getLong, getLong, getObject, getPositionsSizeInBytes, getRegion, getRegionSizeInBytes, getShort, getSingleValueBlock, getSlice, getSliceLength, hash, isNull, mayHaveNull, writeBytesTo, writePositionTopublic ArrayBlockBuilder(BlockBuilder valuesBlock, BlockBuilderStatus blockBuilderStatus, int expectedEntries)
public ArrayBlockBuilder(Type elementType, BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry)
public ArrayBlockBuilder(Type elementType, BlockBuilderStatus blockBuilderStatus, int expectedEntries)
public int getPositionCount()
BlockgetPositionCount in interface Blockpublic long getSizeInBytes()
BlockgetSizeInBytes in interface Blockpublic long getRetainedSizeInBytes()
BlockgetRetainedSizeInBytes in interface Blockpublic void retainedBytesForEachPart(BiConsumer<Object,Long> consumer)
Blockconsumer visits each of the internal data container and accepts the size for it.
This method can be helpful in cases such as memory counting for internal data structure.
Also, the method should be non-recursive, only visit the elements at the top level,
and specifically should not call retainedBytesForEachPart on nested blocks
consumer should be called at least once with the current block and
must include the instance size of the current blockretainedBytesForEachPart in interface Blockprotected Block getRawElementBlock()
getRawElementBlock in class AbstractArrayBlockprotected int[] getOffsets()
getOffsets in class AbstractArrayBlockprotected int getOffsetBase()
getOffsetBase in class AbstractArrayBlockprotected boolean[] getValueIsNull()
getValueIsNull in class AbstractArrayBlockpublic BlockBuilder appendStructure(Block block)
BlockBuilderappendStructure in interface BlockBuilderpublic BlockBuilder appendStructureInternal(Block block, int position)
BlockBuilderappendStructureInternal in interface BlockBuilderpublic SingleArrayBlockWriter beginBlockEntry()
BlockBuilderbeginBlockEntry in interface BlockBuilderpublic BlockBuilder closeEntry()
BlockBuildercloseEntry in interface BlockBuilderpublic BlockBuilder appendNull()
BlockBuilderappendNull in interface BlockBuilderpublic ArrayBlock build()
BlockBuilderbuild in interface BlockBuilderpublic BlockBuilder newBlockBuilderLike(BlockBuilderStatus blockBuilderStatus)
BlockBuildernewBlockBuilderLike in interface BlockBuilderCopyright © 2012–2019. All rights reserved.