public class SavepointV0Serializer extends Object implements SavepointSerializer<SavepointV1>
In contrast to previous savepoint versions, this serializer makes sure that no default Java serialization is used for serialization. Therefore, we don't rely on any involved Java classes to stay the same.
Modifier and Type | Field and Description |
---|---|
static SavepointV0Serializer |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
static KeyGroupsStateHandle |
convertKeyedBackendState(HashMap<String,KvStateSnapshot<?,?,?,?>> oldKeyedState,
int parallelInstanceIdx,
long checkpointID)
This is public so that we can use it when restoring a legacy snapshot
in
AbstractStreamOperatorTestHarness . |
static StreamStateHandle |
convertOperatorAndFunctionState(StreamTaskState streamTaskState)
This is public so that we can use it when restoring a legacy snapshot
in
AbstractStreamOperatorTestHarness . |
static StreamStateHandle |
convertStateHandle(StateHandle<?> oldStateHandle)
This is public so that we can use it when restoring a legacy snapshot
in
AbstractStreamOperatorTestHarness . |
SavepointV1 |
deserialize(DataInputStream dis,
ClassLoader userClassLoader)
Deserializes a savepoint from an input stream.
|
void |
serialize(SavepointV1 savepoint,
DataOutputStream dos)
Serializes a savepoint to an output stream.
|
void |
serializeOld(SavepointV0 savepoint,
DataOutputStream dos) |
public static final SavepointV0Serializer INSTANCE
public void serialize(SavepointV1 savepoint, DataOutputStream dos) throws IOException
SavepointSerializer
serialize
in interface SavepointSerializer<SavepointV1>
savepoint
- Savepoint to serializedos
- Output stream to serialize the savepoint toIOException
- Serialization failures are forwardedpublic SavepointV1 deserialize(DataInputStream dis, ClassLoader userClassLoader) throws IOException
SavepointSerializer
deserialize
in interface SavepointSerializer<SavepointV1>
dis
- Input stream to deserialize savepoint fromuserClassLoader
- the user code class loaderIOException
- Serialization failures are forwardedpublic static StreamStateHandle convertOperatorAndFunctionState(StreamTaskState streamTaskState) throws Exception
AbstractStreamOperatorTestHarness
.Exception
public static KeyGroupsStateHandle convertKeyedBackendState(HashMap<String,KvStateSnapshot<?,?,?,?>> oldKeyedState, int parallelInstanceIdx, long checkpointID) throws Exception
AbstractStreamOperatorTestHarness
.Exception
public static StreamStateHandle convertStateHandle(StateHandle<?> oldStateHandle) throws Exception
AbstractStreamOperatorTestHarness
.Exception
@VisibleForTesting public void serializeOld(SavepointV0 savepoint, DataOutputStream dos) throws IOException
IOException
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.