Class TupleSerializerBase<T>
- java.lang.Object
-
- org.apache.flink.api.common.typeutils.TypeSerializer<T>
-
- org.apache.flink.api.java.typeutils.runtime.TupleSerializerBase<T>
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
TupleSerializer
@Internal public abstract class TupleSerializerBase<T> extends TypeSerializer<T>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intarityprotected TypeSerializer<Object>[]fieldSerializersprotected Class<T>tupleClass
-
Constructor Summary
Constructors Constructor Description TupleSerializerBase(Class<T> tupleClass, TypeSerializer<?>[] fieldSerializers)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcopy(DataInputView source, DataOutputView target)Copies exactly one record from the source input view to the target output view.abstract TcreateInstance(Object[] fields)abstract TcreateOrReuseInstance(Object[] fields, T reuse)booleanequals(Object obj)intgetArity()TypeSerializer<Object>[]getFieldSerializers()intgetLength()Gets the length of the data type, if it is a fix length data type.Class<T>getTupleClass()inthashCode()booleanisImmutableType()Gets whether the type is an immutable type.-
Methods inherited from class org.apache.flink.api.common.typeutils.TypeSerializer
copy, copy, createInstance, deserialize, deserialize, duplicate, serialize, snapshotConfiguration
-
-
-
-
Field Detail
-
fieldSerializers
protected TypeSerializer<Object>[] fieldSerializers
-
arity
protected final int arity
-
-
Constructor Detail
-
TupleSerializerBase
public TupleSerializerBase(Class<T> tupleClass, TypeSerializer<?>[] fieldSerializers)
-
-
Method Detail
-
isImmutableType
public boolean isImmutableType()
Description copied from class:TypeSerializerGets whether the type is an immutable type.- Specified by:
isImmutableTypein classTypeSerializer<T>- Returns:
- True, if the type is immutable.
-
getLength
public int getLength()
Description copied from class:TypeSerializerGets the length of the data type, if it is a fix length data type.- Specified by:
getLengthin classTypeSerializer<T>- Returns:
- The length of the data type, or
-1for variable length data types.
-
getArity
public int getArity()
-
copy
public void copy(DataInputView source, DataOutputView target) throws IOException
Description copied from class:TypeSerializerCopies exactly one record from the source input view to the target output view. Whether this operation works on binary data or partially de-serializes the record to determine its length (such as for records of variable length) is up to the implementer. Binary copies are typically faster. A copy of a record containing two integer numbers (8 bytes total) is most efficiently implemented astarget.write(source, 8);.- Specified by:
copyin classTypeSerializer<T>- Parameters:
source- The input view from which to read the record.target- The target output view to which to write the record.- Throws:
IOException- Thrown if any of the two views raises an exception.
-
hashCode
public int hashCode()
- Specified by:
hashCodein classTypeSerializer<T>
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin classTypeSerializer<T>
-
getFieldSerializers
@VisibleForTesting public TypeSerializer<Object>[] getFieldSerializers()
-
-