XComp commented on code in PR #19469:
URL: https://github.com/apache/flink/pull/19469#discussion_r850363307


##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java:
##########
@@ -313,11 +296,15 @@ private <T> Optional<T> 
getLatestPriorProperty(Function<ArchivedExecution, T> ex
      * @return The latest prior execution location, or null, if there is none, 
yet.
      */
     public Optional<TaskManagerLocation> findLatestPriorLocation() {
-        return 
getLatestPriorProperty(ArchivedExecution::getAssignedResourceLocation);
+        return Optional.ofNullable(lastAssignedLocation);
+    }
+
+    void setLatestPriorAllocation(AllocationID lastAssignedAllocationID) {

Review Comment:
   I thought about it once more: I think it makes sense to merge 
`setLatestPriorAllocation` and `setLatestPrioirLocation` into something like 
`setLatestPriorSlotAssignment(TaskManagerLocation, AllocationID)` because both 
are closely related...



##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java:
##########
@@ -313,11 +296,15 @@ private <T> Optional<T> 
getLatestPriorProperty(Function<ArchivedExecution, T> ex
      * @return The latest prior execution location, or null, if there is none, 
yet.
      */
     public Optional<TaskManagerLocation> findLatestPriorLocation() {

Review Comment:
   Can we rephrase these `findLatestPrior*` and `setLatestPrior*` methods. 
Because we're setting it now when assigning the resource it means that we 
actually return the latest assignment and not the latest prior assignment...



-- 
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]

Reply via email to