use of org.apache.flink.migration.state.MigrationStreamStateHandle in project flink by apache.
the class SavepointV0Serializer method convertOperatorAndFunctionState.
/**
* This is public so that we can use it when restoring a legacy snapshot
* in {@code AbstractStreamOperatorTestHarness}.
*/
public static StreamStateHandle convertOperatorAndFunctionState(StreamTaskState streamTaskState) throws Exception {
List<StreamStateHandle> mergeStateHandles = new ArrayList<>(4);
StateHandle<Serializable> functionState = streamTaskState.getFunctionState();
StateHandle<?> operatorState = streamTaskState.getOperatorState();
if (null != functionState) {
mergeStateHandles.add(SIGNAL_1);
mergeStateHandles.add(convertStateHandle(functionState));
} else {
mergeStateHandles.add(SIGNAL_0);
}
if (null != operatorState) {
mergeStateHandles.add(convertStateHandle(operatorState));
}
return new MigrationStreamStateHandle(new MultiStreamStateHandle(mergeStateHandles));
}
Aggregations