Class MetadataV3Serializer
- java.lang.Object
-
- org.apache.flink.runtime.checkpoint.metadata.MetadataV2V3SerializerBase
-
- org.apache.flink.runtime.checkpoint.metadata.MetadataV3Serializer
-
- All Implemented Interfaces:
Versioned
,MetadataSerializer
- Direct Known Subclasses:
MetadataV4Serializer
@Internal public class MetadataV3Serializer extends MetadataV2V3SerializerBase implements MetadataSerializer
(De)serializer for checkpoint metadata format version 3. This format was introduced with Apache Flink 1.11.0.Compared to format version 2, this drops some unused fields and introduces operator coordinator state.
See
MetadataV2V3SerializerBase
for a description of the format layout.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.runtime.checkpoint.metadata.MetadataV2V3SerializerBase
MetadataV2V3SerializerBase.DeserializationContext
-
-
Field Summary
Fields Modifier and Type Field Description static MetadataV3Serializer
INSTANCE
The singleton instance of the serializer.static int
VERSION
The metadata format version.
-
Constructor Summary
Constructors Modifier Constructor Description protected
MetadataV3Serializer()
Singleton, not meant to be instantiated.
-
Method Summary
-
Methods inherited from class org.apache.flink.runtime.checkpoint.metadata.MetadataV2V3SerializerBase
deserializeMasterState, deserializeMetadata, deserializeSubtaskState, serializeMasterState, serializeMetadata
-
-
-
-
Field Detail
-
VERSION
public static final int VERSION
The metadata format version.- See Also:
- Constant Field Values
-
INSTANCE
public static final MetadataV3Serializer INSTANCE
The singleton instance of the serializer.
-
-
Method Detail
-
getVersion
public int getVersion()
Description copied from interface:Versioned
Returns the version number of the object. Versions numbers can be used to differentiate evolving classes.- Specified by:
getVersion
in interfaceVersioned
-
serialize
public void serialize(CheckpointMetadata checkpointMetadata, DataOutputStream dos) throws IOException
Description copied from interface:MetadataSerializer
Serializes a savepoint or checkpoint metadata to an output stream.- Specified by:
serialize
in interfaceMetadataSerializer
- Throws:
IOException
- Serialization failures are forwarded
-
deserialize
public CheckpointMetadata deserialize(DataInputStream dis, ClassLoader classLoader, String externalPointer) throws IOException
Description copied from interface:MetadataSerializer
Deserializes a savepoint from an input stream.- Specified by:
deserialize
in interfaceMetadataSerializer
- Parameters:
dis
- Input stream to deserialize savepoint fromclassLoader
- the user code class loaderexternalPointer
- the external pointer of the given checkpoint- Returns:
- The deserialized savepoint
- Throws:
IOException
- Serialization failures are forwarded
-
serializeOperatorState
protected void serializeOperatorState(OperatorState operatorState, DataOutputStream dos) throws IOException
- Specified by:
serializeOperatorState
in classMetadataV2V3SerializerBase
- Throws:
IOException
-
serializeSubtaskState
protected void serializeSubtaskState(OperatorSubtaskState subtaskState, DataOutputStream dos) throws IOException
- Overrides:
serializeSubtaskState
in classMetadataV2V3SerializerBase
- Throws:
IOException
-
deserializeOperatorState
protected OperatorState deserializeOperatorState(DataInputStream dis, @Nullable MetadataV2V3SerializerBase.DeserializationContext context) throws IOException
- Specified by:
deserializeOperatorState
in classMetadataV2V3SerializerBase
- Throws:
IOException
-
deserializeSubtaskIndexAndFinishedState
protected org.apache.flink.runtime.checkpoint.metadata.MetadataV3Serializer.SubtaskAndFinishedState deserializeSubtaskIndexAndFinishedState(DataInputStream dis) throws IOException
- Throws:
IOException
-
serializeResultSubpartitionStateHandle
@VisibleForTesting public void serializeResultSubpartitionStateHandle(ResultSubpartitionStateHandle handle, DataOutputStream dos) throws IOException
- Overrides:
serializeResultSubpartitionStateHandle
in classMetadataV2V3SerializerBase
- Throws:
IOException
-
deserializeResultSubpartitionStateHandle
@VisibleForTesting public StateObjectCollection<ResultSubpartitionStateHandle> deserializeResultSubpartitionStateHandle(DataInputStream dis, @Nullable MetadataV2V3SerializerBase.DeserializationContext context) throws IOException
- Overrides:
deserializeResultSubpartitionStateHandle
in classMetadataV2V3SerializerBase
- Throws:
IOException
-
serializeInputChannelStateHandle
@VisibleForTesting public void serializeInputChannelStateHandle(InputChannelStateHandle handle, DataOutputStream dos) throws IOException
- Overrides:
serializeInputChannelStateHandle
in classMetadataV2V3SerializerBase
- Throws:
IOException
-
deserializeInputChannelStateHandle
@VisibleForTesting public StateObjectCollection<InputChannelStateHandle> deserializeInputChannelStateHandle(DataInputStream dis, @Nullable MetadataV2V3SerializerBase.DeserializationContext context) throws IOException
- Overrides:
deserializeInputChannelStateHandle
in classMetadataV2V3SerializerBase
- Throws:
IOException
-
serializeStreamStateHandle
@VisibleForTesting public static void serializeStreamStateHandle(StreamStateHandle stateHandle, DataOutputStream dos) throws IOException
- Throws:
IOException
-
deserializeStreamStateHandle
@VisibleForTesting public static StreamStateHandle deserializeStreamStateHandle(DataInputStream dis) throws IOException
- Throws:
IOException
-
serializeOperatorStateHandleUtil
@VisibleForTesting public static void serializeOperatorStateHandleUtil(OperatorStateHandle stateHandle, DataOutputStream dos) throws IOException
- Throws:
IOException
-
deserializeOperatorStateHandleUtil
@VisibleForTesting public static OperatorStateHandle deserializeOperatorStateHandleUtil(DataInputStream dis) throws IOException
- Throws:
IOException
-
serializeKeyedStateHandleUtil
@VisibleForTesting public static void serializeKeyedStateHandleUtil(KeyedStateHandle stateHandle, DataOutputStream dos) throws IOException
- Throws:
IOException
-
deserializeKeyedStateHandleUtil
@VisibleForTesting public static KeyedStateHandle deserializeKeyedStateHandleUtil(DataInputStream dis) throws IOException
- Throws:
IOException
-
deserializeInputChannelStateHandle
@VisibleForTesting public static StateObjectCollection<InputChannelStateHandle> deserializeInputChannelStateHandle(DataInputStream dis) throws IOException
- Throws:
IOException
-
deserializeResultSubpartitionStateHandle
@VisibleForTesting public StateObjectCollection<ResultSubpartitionStateHandle> deserializeResultSubpartitionStateHandle(DataInputStream dis) throws IOException
- Throws:
IOException
-
-