Class CommittableMessageSerializer<CommT>
- java.lang.Object
-
- org.apache.flink.streaming.api.connector.sink2.CommittableMessageSerializer<CommT>
-
- Type Parameters:
CommT
-
- All Implemented Interfaces:
SimpleVersionedSerializer<CommittableMessage<CommT>>
,Versioned
@Internal public class CommittableMessageSerializer<CommT> extends Object implements SimpleVersionedSerializer<CommittableMessage<CommT>>
The serializer to serializeCommittableMessage
s in custom operators.
-
-
Constructor Summary
Constructors Constructor Description CommittableMessageSerializer(SimpleVersionedSerializer<CommT> committableSerializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommittableMessage<CommT>
deserialize(int version, byte[] serialized)
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(CommittableMessage<CommT> obj)
Serializes the given object.
-
-
-
Constructor Detail
-
CommittableMessageSerializer
public CommittableMessageSerializer(SimpleVersionedSerializer<CommT> committableSerializer)
-
-
Method Detail
-
getVersion
public int getVersion()
Description copied from interface:SimpleVersionedSerializer
Gets the version with which this serializer serializes.- Specified by:
getVersion
in interfaceSimpleVersionedSerializer<CommT>
- Specified by:
getVersion
in interfaceVersioned
- Returns:
- The version of the serialization schema.
-
serialize
public byte[] serialize(CommittableMessage<CommT> obj) 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<CommT>
- Parameters:
obj
- The object to serialize.- Returns:
- The serialized data (bytes).
- Throws:
IOException
- Thrown, if the serialization fails.
-
deserialize
public CommittableMessage<CommT> deserialize(int version, byte[] serialized) 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<CommT>
- Parameters:
version
- The version in which the data was serializedserialized
- The serialized data- Returns:
- The deserialized object
- Throws:
IOException
- Thrown, if the deserialization fails.
-
-