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 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
FieldsModifier and TypeFieldDescriptionstatic final MetadataV3SerializerThe singleton instance of the serializer.static final intThe metadata format version. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSingleton, not meant to be instantiated. -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(DataInputStream dis, ClassLoader classLoader, String externalPointer) Deserializes a savepoint from an input stream.deserializeInputChannelStateHandle(DataInputStream dis, MetadataV2V3SerializerBase.DeserializationContext context) static KeyedStateHandleprotected OperatorStatedeserializeOperatorState(DataInputStream dis, MetadataV2V3SerializerBase.DeserializationContext context) static OperatorStateHandledeserializeResultSubpartitionStateHandle(DataInputStream dis, MetadataV2V3SerializerBase.DeserializationContext context) static StreamStateHandleprotected org.apache.flink.runtime.checkpoint.metadata.MetadataV3Serializer.SubtaskAndFinishedStateintvoidserialize(CheckpointMetadata checkpointMetadata, DataOutputStream dos) Serializes a savepoint or checkpoint metadata to an output stream.voidstatic voidserializeKeyedStateHandleUtil(KeyedStateHandle stateHandle, DataOutputStream dos) protected voidserializeOperatorState(OperatorState operatorState, DataOutputStream dos) static voidserializeOperatorStateHandleUtil(OperatorStateHandle stateHandle, DataOutputStream dos) voidstatic voidserializeStreamStateHandle(StreamStateHandle stateHandle, DataOutputStream dos) protected voidserializeSubtaskState(OperatorSubtaskState subtaskState, DataOutputStream dos) Methods inherited from class org.apache.flink.runtime.checkpoint.metadata.MetadataV2V3SerializerBase
deserializeMasterState, deserializeMetadata, deserializeSubtaskState, serializeMasterState, serializeMetadata
-
Field Details
-
VERSION
public static final int VERSIONThe metadata format version.- See Also:
-
INSTANCE
The singleton instance of the serializer.
-
-
Constructor Details
-
MetadataV3Serializer
protected MetadataV3Serializer()Singleton, not meant to be instantiated.
-
-
Method Details
-
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
-
serializeResultSubpartitionStateHandle
@VisibleForTesting public void serializeResultSubpartitionStateHandle(ResultSubpartitionStateHandle handle, DataOutputStream dos) throws IOException - Overrides:
serializeResultSubpartitionStateHandlein classMetadataV2V3SerializerBase- Throws:
IOException
-
deserializeResultSubpartitionStateHandle
@VisibleForTesting public StateObjectCollection<ResultSubpartitionStateHandle> deserializeResultSubpartitionStateHandle(DataInputStream dis, @Nullable MetadataV2V3SerializerBase.DeserializationContext context) throws IOException - Overrides:
deserializeResultSubpartitionStateHandlein classMetadataV2V3SerializerBase- Throws:
IOException
-
serializeInputChannelStateHandle
@VisibleForTesting public void serializeInputChannelStateHandle(InputChannelStateHandle handle, DataOutputStream dos) throws IOException - Overrides:
serializeInputChannelStateHandlein classMetadataV2V3SerializerBase- Throws:
IOException
-
deserializeInputChannelStateHandle
@VisibleForTesting public StateObjectCollection<InputChannelStateHandle> deserializeInputChannelStateHandle(DataInputStream dis, @Nullable MetadataV2V3SerializerBase.DeserializationContext context) throws IOException - Overrides:
deserializeInputChannelStateHandlein 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
-