Class BinaryArrayWriter

  • All Implemented Interfaces:
    BinaryWriter

    @Internal
    public final class BinaryArrayWriter
    extends Object
    Writer for binary array. See BinaryArrayData.
    • Field Detail

      • segment

        protected org.apache.flink.core.memory.MemorySegment segment
      • cursor

        protected int cursor
      • outputView

        protected org.apache.flink.core.memory.DataOutputViewStreamWrapper outputView
    • Constructor Detail

      • BinaryArrayWriter

        public BinaryArrayWriter​(org.apache.flink.table.data.binary.BinaryArrayData array,
                                 int numElements,
                                 int elementSize)
    • Method Detail

      • reset

        public void reset()
        First, reset.
      • setNullBit

        public void setNullBit​(int ordinal)
      • setNullBoolean

        public void setNullBoolean​(int ordinal)
      • setNullByte

        public void setNullByte​(int ordinal)
      • setNullShort

        public void setNullShort​(int ordinal)
      • setNullInt

        public void setNullInt​(int ordinal)
      • setNullLong

        public void setNullLong​(int ordinal)
      • setNullFloat

        public void setNullFloat​(int ordinal)
      • setNullDouble

        public void setNullDouble​(int ordinal)
      • setNullAt

        public void setNullAt​(int ordinal)
        Description copied from interface: BinaryWriter
        Set null to this field.
      • setNullAt

        @Deprecated
        public void setNullAt​(int pos,
                              org.apache.flink.table.types.logical.LogicalType type)
        Deprecated.
        Use createNullSetter(LogicalType) for avoiding logical types during runtime.
      • getFieldOffset

        public int getFieldOffset​(int pos)
        Get field offset.
      • setOffsetAndSize

        public void setOffsetAndSize​(int pos,
                                     int offset,
                                     long size)
        Set offset and size to fix len part.
      • writeBoolean

        public void writeBoolean​(int pos,
                                 boolean value)
      • writeByte

        public void writeByte​(int pos,
                              byte value)
      • writeShort

        public void writeShort​(int pos,
                               short value)
      • writeInt

        public void writeInt​(int pos,
                             int value)
      • writeLong

        public void writeLong​(int pos,
                              long value)
      • writeFloat

        public void writeFloat​(int pos,
                               float value)
      • writeDouble

        public void writeDouble​(int pos,
                                double value)
      • afterGrow

        public void afterGrow()
        After grow, need point to new memory.
      • complete

        public void complete()
        Finally, complete write to set real size to row.
      • getNumElements

        public int getNumElements()
      • createNullSetter

        public static BinaryArrayWriter.NullSetter createNullSetter​(org.apache.flink.table.types.logical.LogicalType elementType)
        Creates an for accessor setting the elements of an array writer to null during runtime.
        Parameters:
        elementType - the element type of the array
      • writeString

        public void writeString​(int pos,
                                org.apache.flink.table.data.StringData input)
        See BinarySegmentUtils.readStringData(MemorySegment[], int, int, long).
        Specified by:
        writeString in interface BinaryWriter
      • writeBinary

        public void writeBinary​(int pos,
                                byte[] bytes)
        Specified by:
        writeBinary in interface BinaryWriter
      • writeDecimal

        public void writeDecimal​(int pos,
                                 org.apache.flink.table.data.DecimalData value,
                                 int precision)
        Specified by:
        writeDecimal in interface BinaryWriter
      • writeTimestamp

        public void writeTimestamp​(int pos,
                                   org.apache.flink.table.data.TimestampData value,
                                   int precision)
        Specified by:
        writeTimestamp in interface BinaryWriter
      • zeroOutPaddingBytes

        protected void zeroOutPaddingBytes​(int numBytes)
      • ensureCapacity

        protected void ensureCapacity​(int neededSize)
      • roundNumberOfBytesToNearestWord

        protected static int roundNumberOfBytesToNearestWord​(int numBytes)
      • getSegments

        @Internal
        public org.apache.flink.core.memory.MemorySegment getSegments()