public abstract class AbstractBinaryWriter extends Object implements BinaryWriter
MemorySegment (its capacity grows
automatically).
If write a format binary:
1. New a writer.
2. Write each field by writeXX or setNullAt. (Variable length fields can not be written
repeatedly.)
3. Invoke BinaryWriter.complete().
If want to reuse this writer, please invoke BinaryWriter.reset() first.
| Modifier and Type | Field and Description |
|---|---|
protected int |
cursor |
protected org.apache.flink.core.memory.DataOutputViewStreamWrapper |
outputView |
protected org.apache.flink.core.memory.MemorySegment |
segment |
| Constructor and Description |
|---|
AbstractBinaryWriter() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
afterGrow()
After grow, need point to new memory.
|
protected void |
ensureCapacity(int neededSize) |
protected abstract int |
getFieldOffset(int pos)
Get field offset.
|
protected static int |
roundNumberOfBytesToNearestWord(int numBytes) |
protected abstract void |
setNullBit(int ordinal) |
protected abstract void |
setOffsetAndSize(int pos,
int offset,
long size)
Set offset and size to fix len part.
|
void |
writeArray(int pos,
BaseArray input,
BaseArraySerializer serializer) |
void |
writeBinary(int pos,
byte[] bytes) |
void |
writeDecimal(int pos,
Decimal value,
int precision) |
void |
writeGeneric(int pos,
BinaryGeneric input,
BinaryGenericSerializer serializer) |
void |
writeMap(int pos,
BaseMap input,
BaseMapSerializer serializer) |
void |
writeRow(int pos,
BaseRow input,
BaseRowSerializer serializer) |
void |
writeString(int pos,
BinaryString input)
|
protected void |
zeroOutPaddingBytes(int numBytes) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomplete, reset, setNullAt, write, writeBoolean, writeByte, writeDouble, writeFloat, writeInt, writeLong, writeShortprotected org.apache.flink.core.memory.MemorySegment segment
protected int cursor
protected org.apache.flink.core.memory.DataOutputViewStreamWrapper outputView
protected abstract void setOffsetAndSize(int pos,
int offset,
long size)
protected abstract int getFieldOffset(int pos)
protected abstract void afterGrow()
protected abstract void setNullBit(int ordinal)
public void writeString(int pos,
BinaryString input)
writeString in interface BinaryWriterpublic void writeArray(int pos,
BaseArray input,
BaseArraySerializer serializer)
writeArray in interface BinaryWriterpublic void writeMap(int pos,
BaseMap input,
BaseMapSerializer serializer)
writeMap in interface BinaryWriterpublic void writeGeneric(int pos,
BinaryGeneric input,
BinaryGenericSerializer serializer)
writeGeneric in interface BinaryWriterpublic void writeRow(int pos,
BaseRow input,
BaseRowSerializer serializer)
writeRow in interface BinaryWriterpublic void writeBinary(int pos,
byte[] bytes)
writeBinary in interface BinaryWriterpublic void writeDecimal(int pos,
Decimal value,
int precision)
writeDecimal in interface BinaryWriterprotected void zeroOutPaddingBytes(int numBytes)
protected void ensureCapacity(int neededSize)
protected static int roundNumberOfBytesToNearestWord(int numBytes)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.