Class GenericJobEventSerializer
- java.lang.Object
-
- org.apache.flink.runtime.jobmaster.event.GenericJobEventSerializer
-
- All Implemented Interfaces:
SimpleVersionedSerializer<JobEvent>
,Versioned
public class GenericJobEventSerializer extends Object implements SimpleVersionedSerializer<JobEvent>
Serializer forJobEvent
instances that uses Flink'sInstantiationUtil
for serialization and deserialization.
-
-
Field Summary
Fields Modifier and Type Field Description static GenericJobEventSerializer
INSTANCE
-
Constructor Summary
Constructors Constructor Description GenericJobEventSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JobEvent
deserialize(int version, byte[] bytes)
De-serializes the given data (bytes) which was serialized with the scheme of the indicated version.int
getVersion()
Gets the version with which this serializer serializes.byte[]
serialize(JobEvent jobEvent)
Serializes the given object.
-
-
-
Field Detail
-
INSTANCE
public static final GenericJobEventSerializer INSTANCE
-
-
Method Detail
-
getVersion
public int getVersion()
Description copied from interface:SimpleVersionedSerializer
Gets the version with which this serializer serializes.- Specified by:
getVersion
in interfaceSimpleVersionedSerializer<JobEvent>
- Specified by:
getVersion
in interfaceVersioned
- Returns:
- The version of the serialization schema.
-
serialize
public byte[] serialize(JobEvent jobEvent) throws IOException
Description copied from interface:SimpleVersionedSerializer
Serializes the given object. The serialization is assumed to correspond to the current serialization version (as returned bySimpleVersionedSerializer.getVersion()
.- Specified by:
serialize
in interfaceSimpleVersionedSerializer<JobEvent>
- Parameters:
jobEvent
- The object to serialize.- Returns:
- The serialized data (bytes).
- Throws:
IOException
- Thrown, if the serialization fails.
-
deserialize
public JobEvent deserialize(int version, byte[] bytes) throws IOException
Description copied from interface:SimpleVersionedSerializer
De-serializes the given data (bytes) which was serialized with the scheme of the indicated version.- Specified by:
deserialize
in interfaceSimpleVersionedSerializer<JobEvent>
- Parameters:
version
- The version in which the data was serializedbytes
- The serialized data- Returns:
- The deserialized object
- Throws:
IOException
- Thrown, if the deserialization fails.
-
-