use of org.apache.flink.runtime.io.network.api.writer.SubtaskStateMapper in project flink by apache.
the class TaskStateAssignment method getOutputMapping.
public SubtasksRescaleMapping getOutputMapping(int partitionIndex) {
final TaskStateAssignment downstreamAssignment = getDownstreamAssignments()[partitionIndex];
final IntermediateResult output = executionJobVertex.getProducedDataSets()[partitionIndex];
final int gateIndex = downstreamAssignment.executionJobVertex.getInputs().indexOf(output);
final SubtaskStateMapper mapper = checkNotNull(downstreamAssignment.executionJobVertex.getJobVertex().getInputs().get(gateIndex).getUpstreamSubtaskStateMapper(), "No channel rescaler found during rescaling of channel state");
final RescaleMappings mapping = mapper.getNewToOldSubtasksMapping(oldState.get(outputOperatorID).getParallelism(), newParallelism);
return outputSubtaskMappings.compute(partitionIndex, (idx, oldMapping) -> checkSubtaskMapping(oldMapping, mapping, mapper.isAmbiguous()));
}
use of org.apache.flink.runtime.io.network.api.writer.SubtaskStateMapper in project flink by apache.
the class TaskStateAssignment method getInputMapping.
public SubtasksRescaleMapping getInputMapping(int gateIndex) {
final SubtaskStateMapper mapper = checkNotNull(executionJobVertex.getJobVertex().getInputs().get(gateIndex).getDownstreamSubtaskStateMapper(), "No channel rescaler found during rescaling of channel state");
final RescaleMappings mapping = mapper.getNewToOldSubtasksMapping(oldState.get(inputOperatorID).getParallelism(), newParallelism);
return inputSubtaskMappings.compute(gateIndex, (idx, oldMapping) -> checkSubtaskMapping(oldMapping, mapping, mapper.isAmbiguous()));
}
Aggregations