public class WindowKeySerializer extends PagedTypeSerializer<WindowKey>
WindowKey which is composite with a BinaryRowData and a long
value.| Modifier and Type | Class and Description |
|---|---|
static class |
WindowKeySerializer.WindowKeySerializerSnapshot
A
TypeSerializerSnapshot for WindowKeySerializer. |
| Modifier and Type | Field and Description |
|---|---|
static int |
WINDOW_IN_BYTES |
| Constructor and Description |
|---|
WindowKeySerializer(PagedTypeSerializer<org.apache.flink.table.data.RowData> keySerializer) |
| Modifier and Type | Method and Description |
|---|---|
void |
copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target) |
WindowKey |
copy(WindowKey from) |
WindowKey |
copy(WindowKey from,
WindowKey reuse) |
WindowKey |
createInstance() |
WindowKey |
deserialize(org.apache.flink.core.memory.DataInputView source) |
WindowKey |
deserialize(WindowKey reuse,
org.apache.flink.core.memory.DataInputView source) |
WindowKey |
deserializeFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source)
De-serializes a record from the given source paged input view.
|
WindowKey |
deserializeFromPages(WindowKey reuse,
org.apache.flink.runtime.memory.AbstractPagedInputView source)
Reuse version of
PagedTypeSerializer.deserializeFromPages(AbstractPagedInputView). |
org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey> |
duplicate() |
boolean |
equals(Object obj) |
int |
getLength() |
int |
hashCode() |
boolean |
isImmutableType() |
WindowKey |
mapFromPages(WindowKey reuse,
org.apache.flink.runtime.memory.AbstractPagedInputView source)
Map a reused record from the given source paged input view.
|
void |
serialize(WindowKey record,
org.apache.flink.core.memory.DataOutputView target) |
int |
serializeToPages(WindowKey record,
org.apache.flink.runtime.memory.AbstractPagedOutputView target)
Actually, the return value is just for saving checkSkipReadForFixLengthPart in the
mapFromPages, the cost is very small.
|
void |
skipRecordFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source)
Skip over bytes of one record from the paged input view, discarding the skipped bytes.
|
org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<WindowKey> |
snapshotConfiguration() |
public static final int WINDOW_IN_BYTES
public WindowKeySerializer(PagedTypeSerializer<org.apache.flink.table.data.RowData> keySerializer)
public boolean isImmutableType()
isImmutableType in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>public org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey> duplicate()
duplicate in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>public WindowKey createInstance()
createInstance in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>public WindowKey copy(WindowKey from)
copy in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>public WindowKey copy(WindowKey from, WindowKey reuse)
copy in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>public int getLength()
getLength in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>public void serialize(WindowKey record, org.apache.flink.core.memory.DataOutputView target) throws IOException
serialize in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>IOExceptionpublic WindowKey deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>IOExceptionpublic WindowKey deserialize(WindowKey reuse, org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>IOExceptionpublic 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<WindowKey>IOExceptionpublic int serializeToPages(WindowKey record, org.apache.flink.runtime.memory.AbstractPagedOutputView target) throws IOException
TODO so, we can remove this return value for simplifying interface.
serializeToPages in class PagedTypeSerializer<WindowKey>record - The record to serialize.target - 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 WindowKey deserializeFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException
PagedTypeSerializerBinaryRowData. 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 #mapFromPages(T, AbstractPagedInputView).deserializeFromPages in class PagedTypeSerializer<WindowKey>source - 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 WindowKey deserializeFromPages(WindowKey reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException
PagedTypeSerializerPagedTypeSerializer.deserializeFromPages(AbstractPagedInputView).deserializeFromPages in class PagedTypeSerializer<WindowKey>IOExceptionpublic WindowKey mapFromPages(WindowKey reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException
PagedTypeSerializerIf you choose the zero copy way, you have to deal with the lifecycle of the pages properly.
mapFromPages in class PagedTypeSerializer<WindowKey>reuse - the reused record to be mappedsource - 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 void skipRecordFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source)
throws IOException
PagedTypeSerializerskipRecordFromPages in class PagedTypeSerializer<WindowKey>IOExceptionpublic boolean equals(Object obj)
equals in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>public int hashCode()
hashCode in class org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.