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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceAccessor for setting the elements of an array writer during runtime. -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete()Finally, complete write to set real size to binary.static BinaryWriter.ValueSettercreateValueSetter(org.apache.flink.table.types.logical.LogicalType elementType) Creates an accessor for setting the elements of an array writer during runtime.voidreset()Reset writer to prepare next write.voidsetNullAt(int pos) Set null to this field.static voidwrite(BinaryWriter writer, int pos, Object o, org.apache.flink.table.types.logical.LogicalType type, org.apache.flink.api.common.typeutils.TypeSerializer<?> serializer) Deprecated.voidwriteArray(int pos, org.apache.flink.table.data.ArrayData value, ArrayDataSerializer serializer) voidwriteBinary(int pos, byte[] bytes) voidwriteBoolean(int pos, boolean value) voidwriteByte(int pos, byte value) voidwriteDecimal(int pos, org.apache.flink.table.data.DecimalData value, int precision) voidwriteDouble(int pos, double value) voidwriteFloat(int pos, float value) voidwriteInt(int pos, int value) voidwriteLong(int pos, long value) voidwriteMap(int pos, org.apache.flink.table.data.MapData value, MapDataSerializer serializer) voidwriteRawValue(int pos, org.apache.flink.table.data.RawValueData<?> value, RawValueDataSerializer<?> serializer) voidwriteRow(int pos, org.apache.flink.table.data.RowData value, RowDataSerializer serializer) voidwriteShort(int pos, short value) voidwriteString(int pos, org.apache.flink.table.data.StringData value) voidwriteTimestamp(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
-
writeRow
-
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.UsecreateValueSetter(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
-
createValueSetter(LogicalType)for avoiding logical types during runtime.