Class BinaryRowWriter
- java.lang.Object
-
- org.apache.flink.table.data.writer.BinaryRowWriter
-
- All Implemented Interfaces:
BinaryWriter
@Internal public final class BinaryRowWriter extends Object
Writer forBinaryRowData
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.table.data.writer.BinaryWriter
BinaryWriter.ValueSetter
-
-
Field Summary
Fields Modifier and Type Field Description protected int
cursor
protected DataOutputViewStreamWrapper
outputView
protected MemorySegment
segment
-
Constructor Summary
Constructors Constructor Description BinaryRowWriter(BinaryRowData row)
BinaryRowWriter(BinaryRowData row, int initialSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterGrow()
After grow, need point to new memory.void
complete()
Finally, complete write to set real size to binary.protected void
ensureCapacity(int neededSize)
int
getFieldOffset(int pos)
Get field offset.MemorySegment
getSegments()
void
reset()
First, reset.protected static int
roundNumberOfBytesToNearestWord(int numBytes)
void
setNullAt(int pos)
Default not null.void
setNullBit(int pos)
void
setOffsetAndSize(int pos, int offset, long size)
Set offset and size to fix len part.void
writeArray(int pos, ArrayData input, ArrayDataSerializer serializer)
void
writeBinary(int pos, byte[] bytes)
void
writeBoolean(int pos, boolean value)
void
writeByte(int pos, byte value)
void
writeDecimal(int pos, 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, MapData input, MapDataSerializer serializer)
void
writeRawValue(int pos, RawValueData<?> input, RawValueDataSerializer<?> serializer)
void
writeRow(int pos, RowData input, RowDataSerializer serializer)
void
writeRowKind(RowKind kind)
void
writeShort(int pos, short value)
void
writeString(int pos, StringData input)
void
writeTimestamp(int pos, TimestampData value, int precision)
protected void
zeroOutPaddingBytes(int numBytes)
-
-
-
Field Detail
-
segment
protected MemorySegment segment
-
cursor
protected int cursor
-
outputView
protected DataOutputViewStreamWrapper outputView
-
-
Constructor Detail
-
BinaryRowWriter
public BinaryRowWriter(BinaryRowData row)
-
BinaryRowWriter
public BinaryRowWriter(BinaryRowData row, int initialSize)
-
-
Method Detail
-
reset
public void reset()
First, reset.
-
setNullAt
public void setNullAt(int pos)
Default not null.
-
setNullBit
public void setNullBit(int pos)
-
writeRowKind
public void writeRowKind(RowKind kind)
-
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)
-
complete
public void complete()
Description copied from interface:BinaryWriter
Finally, complete write to set real size to binary.
-
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.
-
afterGrow
public void afterGrow()
After grow, need point to new memory.
-
writeString
public void writeString(int pos, StringData input)
- Specified by:
writeString
in interfaceBinaryWriter
-
writeArray
public void writeArray(int pos, ArrayData input, ArrayDataSerializer serializer)
- Specified by:
writeArray
in interfaceBinaryWriter
-
writeMap
public void writeMap(int pos, MapData input, MapDataSerializer serializer)
- Specified by:
writeMap
in interfaceBinaryWriter
-
writeRawValue
public void writeRawValue(int pos, RawValueData<?> input, RawValueDataSerializer<?> serializer)
- Specified by:
writeRawValue
in interfaceBinaryWriter
-
writeRow
public void writeRow(int pos, RowData input, RowDataSerializer serializer)
- Specified by:
writeRow
in interfaceBinaryWriter
-
writeBinary
public void writeBinary(int pos, byte[] bytes)
- Specified by:
writeBinary
in interfaceBinaryWriter
-
writeDecimal
public void writeDecimal(int pos, DecimalData value, int precision)
- Specified by:
writeDecimal
in interfaceBinaryWriter
-
writeTimestamp
public void writeTimestamp(int pos, TimestampData value, int precision)
- Specified by:
writeTimestamp
in interfaceBinaryWriter
-
zeroOutPaddingBytes
protected void zeroOutPaddingBytes(int numBytes)
-
ensureCapacity
protected void ensureCapacity(int neededSize)
-
roundNumberOfBytesToNearestWord
protected static int roundNumberOfBytesToNearestWord(int numBytes)
-
getSegments
@Internal public MemorySegment getSegments()
-
-