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 int
arity
protected TypeSerializer<Object>[]
fieldSerializers
protected 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 void
copy(DataInputView source, DataOutputView target)
Copies exactly one record from the source input view to the target output view.abstract T
createInstance(Object[] fields)
abstract T
createOrReuseInstance(Object[] fields, T reuse)
boolean
equals(Object obj)
int
getArity()
TypeSerializer<Object>[]
getFieldSerializers()
int
getLength()
Gets the length of the data type, if it is a fix length data type.Class<T>
getTupleClass()
int
hashCode()
boolean
isImmutableType()
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:TypeSerializer
Gets whether the type is an immutable type.- Specified by:
isImmutableType
in classTypeSerializer<T>
- Returns:
- True, if the type is immutable.
-
getLength
public int getLength()
Description copied from class:TypeSerializer
Gets the length of the data type, if it is a fix length data type.- Specified by:
getLength
in classTypeSerializer<T>
- Returns:
- The length of the data type, or
-1
for variable length data types.
-
getArity
public int getArity()
-
copy
public void copy(DataInputView source, DataOutputView target) throws IOException
Description copied from class:TypeSerializer
Copies 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:
copy
in 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:
hashCode
in classTypeSerializer<T>
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in classTypeSerializer<T>
-
getFieldSerializers
public TypeSerializer<Object>[] getFieldSerializers()
-
-