Class WindowKeySerializer
java.lang.Object
org.apache.flink.api.common.typeutils.TypeSerializer<T>
org.apache.flink.table.runtime.typeutils.PagedTypeSerializer<WindowKey>
org.apache.flink.table.runtime.typeutils.WindowKeySerializer
- All Implemented Interfaces:
Serializable
Serializer for
WindowKey which is composite with a BinaryRowData and a long
value.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classATypeSerializerSnapshotforWindowKeySerializer. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWindowKeySerializer(PagedTypeSerializer<org.apache.flink.table.data.RowData> keySerializer) -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(org.apache.flink.core.memory.DataInputView source, org.apache.flink.core.memory.DataOutputView target) deserialize(org.apache.flink.core.memory.DataInputView source) deserialize(WindowKey reuse, org.apache.flink.core.memory.DataInputView source) deserializeFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source) De-serializes a record from the given source paged input view.deserializeFromPages(WindowKey reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) Reuse version ofPagedTypeSerializer.deserializeFromPages(AbstractPagedInputView).org.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>booleanintinthashCode()booleanmapFromPages(WindowKey reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) Map a reused record from the given source paged input view.voidintserializeToPages(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.voidskipRecordFromPages(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>
-
Field Details
-
WINDOW_IN_BYTES
public static final int WINDOW_IN_BYTES- See Also:
-
-
Constructor Details
-
WindowKeySerializer
-
-
Method Details
-
isImmutableType
public boolean isImmutableType()- Specified by:
isImmutableTypein classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>
-
duplicate
- Specified by:
duplicatein classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>
-
createInstance
- Specified by:
createInstancein classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>
-
copy
- Specified by:
copyin classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>
-
copy
- Specified by:
copyin classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>
-
getLength
public int getLength()- Specified by:
getLengthin classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>
-
serialize
public void serialize(WindowKey record, org.apache.flink.core.memory.DataOutputView target) throws IOException - Specified by:
serializein classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>- Throws:
IOException
-
deserialize
- Specified by:
deserializein classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>- Throws:
IOException
-
deserialize
public WindowKey deserialize(WindowKey reuse, org.apache.flink.core.memory.DataInputView source) throws IOException - Specified by:
deserializein classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>- Throws:
IOException
-
copy
public void copy(org.apache.flink.core.memory.DataInputView source, org.apache.flink.core.memory.DataOutputView target) throws IOException - Specified by:
copyin classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>- Throws:
IOException
-
serializeToPages
public int serializeToPages(WindowKey record, org.apache.flink.runtime.memory.AbstractPagedOutputView target) throws IOException Actually, the return value is just for saving checkSkipReadForFixLengthPart in the mapFromPages, the cost is very small.TODO so, we can remove this return value for simplifying interface.
- Specified by:
serializeToPagesin classPagedTypeSerializer<WindowKey>- Parameters:
record- The record to serialize.target- The output view to write the serialized data to.- Returns:
- Returns the skipped number of bytes.
- Throws:
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.
-
deserializeFromPages
public WindowKey deserializeFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException Description copied from class:PagedTypeSerializerDe-serializes a record from the given source paged input view. For consistency with serialize format, some implementations may need to skip some bytes of source before de-serializing, .e.gBinaryRowData. 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, seePagedTypeSerializer.mapFromPages(T, AbstractPagedInputView).- Specified by:
deserializeFromPagesin classPagedTypeSerializer<WindowKey>- Parameters:
source- The input view from which to read the data.- Returns:
- The de-serialized element.
- Throws:
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.
-
deserializeFromPages
public WindowKey deserializeFromPages(WindowKey reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException Description copied from class:PagedTypeSerializerReuse version ofPagedTypeSerializer.deserializeFromPages(AbstractPagedInputView).- Specified by:
deserializeFromPagesin classPagedTypeSerializer<WindowKey>- Throws:
IOException
-
mapFromPages
public WindowKey mapFromPages(WindowKey reuse, org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException Description copied from class:PagedTypeSerializerMap a reused record from the given source paged input view. This method provides a possibility to achieve zero copy when de-serializing. You can either choose copy or not copy the content read from source, but we encourage to make it zero copy.If you choose the zero copy way, you have to deal with the lifecycle of the pages properly.
- Specified by:
mapFromPagesin classPagedTypeSerializer<WindowKey>- Parameters:
reuse- the reused record to be mappedsource- The input view from which to read the data.- Returns:
- The mapped record.
- Throws:
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.
-
skipRecordFromPages
public void skipRecordFromPages(org.apache.flink.runtime.memory.AbstractPagedInputView source) throws IOException Description copied from class:PagedTypeSerializerSkip over bytes of one record from the paged input view, discarding the skipped bytes.- Specified by:
skipRecordFromPagesin classPagedTypeSerializer<WindowKey>- Throws:
IOException
-
equals
- Specified by:
equalsin classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>
-
hashCode
public int hashCode()- Specified by:
hashCodein classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>
-
snapshotConfiguration
public org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<WindowKey> snapshotConfiguration()- Specified by:
snapshotConfigurationin classorg.apache.flink.api.common.typeutils.TypeSerializer<WindowKey>
-