public class BinaryRowSerializer extends AbstractRowSerializer<BinaryRow>
BinaryRow.| Modifier and Type | Class and Description |
|---|---|
static class |
BinaryRowSerializer.BinaryRowSerializerSnapshot
TypeSerializerSnapshot for BinaryRowSerializer. |
| Modifier and Type | Field and Description |
|---|---|
static int |
LENGTH_SIZE_IN_BYTES |
| Constructor and Description |
|---|
BinaryRowSerializer(int numFields) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkSkipReadForFixLengthPart(org.apache.flink.runtime.memory.AbstractPagedInputView source)
We need skip bytes to read when the remain bytes of current segment is not
enough to write binary row fixed part.
|
BinaryRow |
copy(BinaryRow from) |
BinaryRow |
copy(BinaryRow from,
BinaryRow reuse) |
void |
copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target) |
void |
copyFromPagesToView(org.apache.flink.runtime.memory.AbstractPagedInputView source,
org.apache.flink.core.memory.DataOutputView target)
Copy a binaryRow which stored in paged input view to output view.
|
BinaryRow |
createInstance() |
BinaryRow |
deserialize(BinaryRow reuse,
org.apache.flink.core.memory.DataInputView source) |
BinaryRow |
deserialize(org.apache.flink.core.memory.DataInputView source) |
BinaryRow |
deserializeFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView headerLessView)
De-serializes a record from the given source paged input view.
|
BinaryRow |
deserializeFromPages(BinaryRow reuse,
org.apache.flink.runtime.memory.AbstractPagedInputView headerLessView)
Reuse version of
AbstractRowSerializer.deserializeFromPages(AbstractPagedInputView). |
org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow> |
duplicate() |
boolean |
equals(Object obj) |
int |
getArity()
Get the number of fields.
|
int |
getFixedLengthPartSize() |
int |
getLength() |
int |
getSerializedRowFixedPartLength()
Return fixed part length to serialize one row.
|
int |
hashCode() |
boolean |
isImmutableType() |
BinaryRow |
mapFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView headerLessView)
Map a record from the given source paged input view.
|
BinaryRow |
mapFromPages(BinaryRow reuse,
org.apache.flink.runtime.memory.AbstractPagedInputView headerLessView)
Reuse version of
AbstractRowSerializer.mapFromPages(AbstractPagedInputView). |
void |
pointTo(int length,
BinaryRow reuse,
org.apache.flink.runtime.memory.AbstractPagedInputView headerLessView)
Point row to memory segments with offset(in the AbstractPagedInputView) and length.
|
void |
serialize(BinaryRow record,
org.apache.flink.core.memory.DataOutputView target) |
int |
serializeToPages(BinaryRow record,
org.apache.flink.runtime.memory.AbstractPagedOutputView headerLessView)
Serializes the given record to the given target paged output view.
|
static void |
serializeWithoutLengthSlow(BinaryRow record,
org.apache.flink.core.memory.MemorySegmentWritable out) |
org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<BinaryRow> |
snapshotConfiguration() |
BinaryRow |
toBinaryRow(BinaryRow baseRow)
|
public static final int LENGTH_SIZE_IN_BYTES
public boolean isImmutableType()
isImmutableType in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>public org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow> duplicate()
duplicate in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>public BinaryRow createInstance()
createInstance in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>public BinaryRow copy(BinaryRow from)
copy in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>public BinaryRow copy(BinaryRow from, BinaryRow reuse)
copy in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>public int getLength()
getLength in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>public void serialize(BinaryRow record, org.apache.flink.core.memory.DataOutputView target) throws IOException
serialize in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>IOExceptionpublic BinaryRow deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>IOExceptionpublic BinaryRow deserialize(BinaryRow reuse, org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>IOExceptionpublic int getArity()
AbstractRowSerializergetArity in class AbstractRowSerializer<BinaryRow>public BinaryRow toBinaryRow(BinaryRow baseRow) throws IOException
AbstractRowSerializertoBinaryRow in class AbstractRowSerializer<BinaryRow>IOExceptionpublic int serializeToPages(BinaryRow record, org.apache.flink.runtime.memory.AbstractPagedOutputView headerLessView) throws IOException
AbstractRowSerializerBinaryRow.serializeToPages in class AbstractRowSerializer<BinaryRow>record - The record to serialize.headerLessView - The output view to write the serialized data to.IOException - Thrown, if the serialization encountered an I/O related error.
Typically raised by the output view, which may have an underlying
I/O channel to which it delegates.public static void serializeWithoutLengthSlow(BinaryRow record, org.apache.flink.core.memory.MemorySegmentWritable out) throws IOException
IOExceptionpublic BinaryRow deserializeFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView headerLessView) throws IOException
AbstractRowSerializerBinaryRow. Typically, the content read from source should be copied out when
de-serializing, and we are not expecting the underlying data from source is reused. If you
have such requirement, see AbstractRowSerializer.mapFromPages(AbstractPagedInputView).deserializeFromPages in class AbstractRowSerializer<BinaryRow>headerLessView - The input view from which to read the data.IOException - Thrown, if the de-serialization encountered an I/O related error.
Typically raised by the input view, which may have an underlying I/O
channel from which it reads.public BinaryRow deserializeFromPages(BinaryRow reuse, org.apache.flink.runtime.memory.AbstractPagedInputView headerLessView) throws IOException
AbstractRowSerializerAbstractRowSerializer.deserializeFromPages(AbstractPagedInputView).deserializeFromPages in class AbstractRowSerializer<BinaryRow>IOExceptionpublic BinaryRow mapFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView headerLessView) throws IOException
AbstractRowSerializerIf you choose the zero copy way, you have to deal with the lifecycle of the pages properly.
mapFromPages in class AbstractRowSerializer<BinaryRow>headerLessView - The input view from which to read the data.IOException - Thrown, if the de-serialization encountered an I/O related error.
Typically raised by the input view, which may have an underlying I/O
channel from which it reads.public BinaryRow mapFromPages(BinaryRow reuse, org.apache.flink.runtime.memory.AbstractPagedInputView headerLessView) throws IOException
AbstractRowSerializerAbstractRowSerializer.mapFromPages(AbstractPagedInputView).mapFromPages in class AbstractRowSerializer<BinaryRow>IOExceptionpublic void copyFromPagesToView(org.apache.flink.runtime.memory.AbstractPagedInputView source,
org.apache.flink.core.memory.DataOutputView target)
throws IOException
source - source paged input view where the binary row storedtarget - the target output view.IOExceptionpublic void pointTo(int length,
BinaryRow reuse,
org.apache.flink.runtime.memory.AbstractPagedInputView headerLessView)
throws IOException
length - row length.reuse - reuse BinaryRow object.headerLessView - source memory segments container.IOExceptionpublic void checkSkipReadForFixLengthPart(org.apache.flink.runtime.memory.AbstractPagedInputView source)
throws IOException
BinaryRow.IOExceptionpublic int getSerializedRowFixedPartLength()
public int getFixedLengthPartSize()
public void copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target)
throws IOException
copy in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>IOExceptionpublic boolean equals(Object obj)
equals in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>public int hashCode()
hashCode in class org.apache.flink.api.common.typeutils.TypeSerializer<BinaryRow>Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.