Class ArrayBlockBuilder

    • Constructor Detail

      • ArrayBlockBuilder

        public 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

        public ArrayBlockBuilder​(Type elementType,
                                 BlockBuilderStatus blockBuilderStatus,
                                 int expectedEntries,
                                 int expectedBytesPerEntry)
      • ArrayBlockBuilder

        public ArrayBlockBuilder​(Type elementType,
                                 BlockBuilderStatus blockBuilderStatus,
                                 int expectedEntries)
    • Method Detail

      • getPositionCount

        public int getPositionCount()
        Description copied from interface: Block
        Returns the number of positions in this block.
        Specified by:
        getPositionCount in interface Block
      • getSizeInBytes

        public long getSizeInBytes()
        Description copied from interface: Block
        Returns the size of this block as if it was compacted, ignoring any over-allocations and any unloaded nested blocks. For example, in dictionary blocks, this only counts each dictionary entry once, rather than each time a value is referenced.
        Specified by:
        getSizeInBytes in interface Block
      • getRetainedSizeInBytes

        public long getRetainedSizeInBytes()
        Description copied from interface: Block
        Returns the retained size of this block in memory, including over-allocations. This method is called from the inner most execution loop and must be fast.
        Specified by:
        getRetainedSizeInBytes in interface Block
      • retainedBytesForEachPart

        public void retainedBytesForEachPart​(BiConsumer<Object,​Long> consumer)
        Description copied from interface: Block
        consumer 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 block
        Specified by:
        retainedBytesForEachPart in interface Block
      • getValueIsNull

        @Nullable
        protected boolean[] getValueIsNull()
        Specified by:
        getValueIsNull in class AbstractArrayBlock
        Returns:
        the underlying valueIsNull array, or null when all values are guaranteed to be non-null
      • mayHaveNull

        public boolean mayHaveNull()
        Description copied from interface: Block
        Is it possible the block may have a null value? If false, the block cannot contain a null, but if true, the block may or may not have a null.
        Specified by:
        mayHaveNull in interface Block
      • appendStructureInternal

        public BlockBuilder appendStructureInternal​(Block block,
                                                    int position)
        Description copied from interface: BlockBuilder
        Do not use this interface outside block package. Instead, use Block.writePositionTo(BlockBuilder, position)
        Specified by:
        appendStructureInternal in interface BlockBuilder
      • beginBlockEntry

        public SingleArrayBlockWriter beginBlockEntry()
        Description copied from interface: BlockBuilder
        Return a writer to the current entry. The caller can operate on the returned caller to incrementally build the object. This is generally more efficient than building the object elsewhere and call writeObject afterwards because a large chunk of memory could potentially be unnecessarily copied in this process.
        Specified by:
        beginBlockEntry in interface BlockBuilder