Class MetadataV3Serializer
- java.lang.Object
-
- org.apache.flink.runtime.checkpoint.metadata.MetadataV2V3SerializerBase
-
- org.apache.flink.runtime.checkpoint.metadata.MetadataV3Serializer
-
- All Implemented Interfaces:
org.apache.flink.core.io.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
MetadataV2V3SerializerBasefor 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 MetadataV3SerializerINSTANCEThe singleton instance of the serializer.static intVERSIONThe metadata format version.
-
Constructor Summary
Constructors Modifier Constructor Description protectedMetadataV3Serializer()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()
- Specified by:
getVersionin interfaceorg.apache.flink.core.io.Versioned
-
serialize
public void serialize(CheckpointMetadata checkpointMetadata, DataOutputStream dos) throws IOException
Description copied from interface:MetadataSerializerSerializes a savepoint or checkpoint metadata to an output stream.- Specified by:
serializein interfaceMetadataSerializer- Throws:
IOException- Serialization failures are forwarded
-
deserialize
public CheckpointMetadata deserialize(DataInputStream dis, ClassLoader classLoader, String externalPointer) throws IOException
Description copied from interface:MetadataSerializerDeserializes a savepoint from an input stream.- Specified by:
deserializein 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:
serializeOperatorStatein classMetadataV2V3SerializerBase- Throws:
IOException
-
serializeSubtaskState
protected void serializeSubtaskState(OperatorSubtaskState subtaskState, DataOutputStream dos) throws IOException
- Overrides:
serializeSubtaskStatein classMetadataV2V3SerializerBase- Throws:
IOException
-
deserializeOperatorState
protected OperatorState deserializeOperatorState(DataInputStream dis, @Nullable MetadataV2V3SerializerBase.DeserializationContext context) throws IOException
- Specified by:
deserializeOperatorStatein classMetadataV2V3SerializerBase- Throws:
IOException
-
deserializeSubtaskIndexAndFinishedState
protected org.apache.flink.runtime.checkpoint.metadata.MetadataV3Serializer.SubtaskAndFinishedState deserializeSubtaskIndexAndFinishedState(DataInputStream dis) throws IOException
- Throws:
IOException
-
getChannelStateHandleSerializer
protected org.apache.flink.runtime.checkpoint.metadata.ChannelStateHandleSerializer getChannelStateHandleSerializer()
-
serializeOutputStateHandle
@VisibleForTesting public void serializeOutputStateHandle(OutputStateHandle handle, DataOutputStream dos) throws IOException
- Overrides:
serializeOutputStateHandlein classMetadataV2V3SerializerBase- Throws:
IOException
-
deserializeOutputStateHandle
public StateObjectCollection<OutputStateHandle> deserializeOutputStateHandle(DataInputStream dis, @Nullable MetadataV2V3SerializerBase.DeserializationContext context) throws IOException
- Overrides:
deserializeOutputStateHandlein classMetadataV2V3SerializerBase- Throws:
IOException
-
serializeInputStateHandle
@VisibleForTesting public void serializeInputStateHandle(InputStateHandle handle, DataOutputStream dos) throws IOException
- Overrides:
serializeInputStateHandlein classMetadataV2V3SerializerBase- Throws:
IOException
-
deserializeInputStateHandle
public StateObjectCollection<InputStateHandle> deserializeInputStateHandle(DataInputStream dis, @Nullable MetadataV2V3SerializerBase.DeserializationContext context) throws IOException
- Overrides:
deserializeInputStateHandlein 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 void serializeOperatorStateHandleUtil(OperatorStateHandle stateHandle, DataOutputStream dos) throws IOException
- Throws:
IOException
-
deserializeOperatorStateHandleUtil
@VisibleForTesting public OperatorStateHandle deserializeOperatorStateHandleUtil(DataInputStream dis) throws IOException
- Throws:
IOException
-
serializeKeyedStateHandleUtil
@VisibleForTesting public void serializeKeyedStateHandleUtil(KeyedStateHandle stateHandle, DataOutputStream dos) throws IOException
- Throws:
IOException
-
deserializeKeyedStateHandleUtil
@VisibleForTesting public KeyedStateHandle deserializeKeyedStateHandleUtil(DataInputStream dis) throws IOException
- Throws:
IOException
-
deserializeInputStateHandle
@VisibleForTesting public StateObjectCollection<InputStateHandle> deserializeInputStateHandle(DataInputStream dis) throws IOException
- Throws:
IOException
-
deserializeOutputStateHandle
@VisibleForTesting public StateObjectCollection<OutputStateHandle> deserializeOutputStateHandle(DataInputStream dis) throws IOException
- Throws:
IOException
-
-