Search in sources :

Example 1 with SubtaskStateMapper

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()));
}
Also used : IntermediateResult(org.apache.flink.runtime.executiongraph.IntermediateResult) SubtaskStateMapper(org.apache.flink.runtime.io.network.api.writer.SubtaskStateMapper)

Example 2 with SubtaskStateMapper

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()));
}
Also used : SubtaskStateMapper(org.apache.flink.runtime.io.network.api.writer.SubtaskStateMapper)

Aggregations

SubtaskStateMapper (org.apache.flink.runtime.io.network.api.writer.SubtaskStateMapper)2 IntermediateResult (org.apache.flink.runtime.executiongraph.IntermediateResult)1