rkhachatryan commented on code in PR #28856:
URL: https://github.com/apache/flink/pull/28856#discussion_r3692240044
##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/TaskStateAssignment.java:
##########
@@ -272,10 +266,13 @@ public OperatorSubtaskState
getSubtaskState(OperatorInstanceID instanceID) {
instanceID,
inputOperatorID,
getUpstreamAssignments(),
- (assignment, recompute) -> {
+ (gateIndex, assignment, recompute) -> {
int assignmentIndex =
- getAssignmentIndex(
-
assignment.getDownstreamAssignments(), this);
+
assignment.findResultPartitionIndex(
+ executionJobVertex
+ .getInputs()
+ .get(gateIndex)
+ .getId());
Review Comment:
Can we simplify this with something like
```
private SubtasksRescaleMapping getOutputMapping(
IntermediateDataSetID resultId, boolean recompute) {
return getOutputMapping(findResultPartitionIndex(resultId), recompute);
}
private SubtasksRescaleMapping getInputMapping(
IntermediateDataSetID resultId, boolean recompute) {
return getInputMapping(findInputGateIndex(resultId), recompute);
}
// getSubtaskState (input side)
(gateIndex, assignment, recompute) ->
assignment.getOutputMapping(
executionJobVertex.getInputs().get(gateIndex).getId(),
recompute)
// computeOutputRescalingDescriptor (output side)
(partitionIndex, downstreamAssignment, recompute) ->
downstreamAssignment.getInputMapping(
executionJobVertex.getProducedDataSets()[partitionIndex].getId(), recompute)
```
?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]