Interface BinaryWriter

All Known Implementing Classes:
BinaryArrayWriter, BinaryRowWriter

@Internal public interface BinaryWriter
Writer to write a composite data format, like row, array. 1. Invoke reset(). 2. Write each field by writeXX or setNullAt. (Same field can not be written repeatedly.) 3. Invoke complete().
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Accessor for setting the elements of an array writer during runtime.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Finally, complete write to set real size to binary.
    createValueSetter(org.apache.flink.table.types.logical.LogicalType elementType)
    Creates an accessor for setting the elements of an array writer during runtime.
    void
    Reset writer to prepare next write.
    void
    setNullAt(int pos)
    Set null to this field.
    static void
    write(BinaryWriter writer, int pos, Object o, org.apache.flink.table.types.logical.LogicalType type, org.apache.flink.api.common.typeutils.TypeSerializer<?> serializer)
    Deprecated.
    Use createValueSetter(LogicalType) for avoiding logical types during runtime.
    void
    writeArray(int pos, org.apache.flink.table.data.ArrayData value, ArrayDataSerializer serializer)
     
    void
    writeBinary(int pos, byte[] bytes)
     
    void
    writeBoolean(int pos, boolean value)
     
    void
    writeByte(int pos, byte value)
     
    void
    writeDecimal(int pos, org.apache.flink.table.data.DecimalData value, int precision)
     
    void
    writeDouble(int pos, double value)
     
    void
    writeFloat(int pos, float value)
     
    void
    writeInt(int pos, int value)
     
    void
    writeLong(int pos, long value)
     
    void
    writeMap(int pos, org.apache.flink.table.data.MapData value, MapDataSerializer serializer)
     
    void
    writeRawValue(int pos, org.apache.flink.table.data.RawValueData<?> value, RawValueDataSerializer<?> serializer)
     
    void
    writeRow(int pos, org.apache.flink.table.data.RowData value, RowDataSerializer serializer)
     
    void
    writeShort(int pos, short value)
     
    void
    writeString(int pos, org.apache.flink.table.data.StringData value)
     
    void
    writeTimestamp(int pos, org.apache.flink.table.data.TimestampData value, int precision)
     
  • Method Details

    • reset

      void reset()
      Reset writer to prepare next write.
    • setNullAt

      void setNullAt(int pos)
      Set null to this field.
    • writeBoolean

      void writeBoolean(int pos, boolean value)
    • writeByte

      void writeByte(int pos, byte value)
    • writeShort

      void writeShort(int pos, short value)
    • writeInt

      void writeInt(int pos, int value)
    • writeLong

      void writeLong(int pos, long value)
    • writeFloat

      void writeFloat(int pos, float value)
    • writeDouble

      void writeDouble(int pos, double value)
    • writeString

      void writeString(int pos, org.apache.flink.table.data.StringData value)
    • writeBinary

      void writeBinary(int pos, byte[] bytes)
    • writeDecimal

      void writeDecimal(int pos, org.apache.flink.table.data.DecimalData value, int precision)
    • writeTimestamp

      void writeTimestamp(int pos, org.apache.flink.table.data.TimestampData value, int precision)
    • writeArray

      void writeArray(int pos, org.apache.flink.table.data.ArrayData value, ArrayDataSerializer serializer)
    • writeMap

      void writeMap(int pos, org.apache.flink.table.data.MapData value, MapDataSerializer serializer)
    • writeRow

      void writeRow(int pos, org.apache.flink.table.data.RowData value, RowDataSerializer serializer)
    • writeRawValue

      void writeRawValue(int pos, org.apache.flink.table.data.RawValueData<?> value, RawValueDataSerializer<?> serializer)
    • complete

      void complete()
      Finally, complete write to set real size to binary.
    • write

      @Deprecated static void write(BinaryWriter writer, int pos, Object o, org.apache.flink.table.types.logical.LogicalType type, org.apache.flink.api.common.typeutils.TypeSerializer<?> serializer)
      Deprecated.
      Use createValueSetter(LogicalType) for avoiding logical types during runtime.
    • createValueSetter

      static BinaryWriter.ValueSetter createValueSetter(org.apache.flink.table.types.logical.LogicalType elementType)
      Creates an accessor for setting the elements of an array writer during runtime.
      Parameters:
      elementType - the element type of the array