danzhewuju commented on code in PR #29460:
URL: https://github.com/apache/flink/pull/29460#discussion_r4255124776
##########
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/rescales/JobRescaleDetailsHandler.java:
##########
@@ -101,20 +103,31 @@ protected JobRescaleDetails handleRequest(
@Override
public Collection<ArchivedJson> archiveJsonWithPath(ExecutionGraphInfo
executionGraphInfo)
throws IOException {
- if (executionGraphInfo.getRescalesStatsSnapshot() == null
- ||
executionGraphInfo.getRescalesStatsSnapshot().getRescaleHistory() == null) {
+ final RescalesStatsSnapshot rescalesStatsSnapshot =
+ executionGraphInfo.getRescalesStatsSnapshot();
+ if (rescalesStatsSnapshot == null ||
rescalesStatsSnapshot.getRescaleHistory() == null) {
return List.of();
}
List<ArchivedJson> archives = new ArrayList<>();
- List<Rescale> rescales =
executionGraphInfo.getRescalesStatsSnapshot().getRescaleHistory();
+ final Map<RescaleIdInfo.RescaleUUID, Rescale> rescalesById = new
LinkedHashMap<>();
Review Comment:
Thanks for the suggestion. I adopted the same idea by extending the existing
idToRescaleMap with the latest rescales when the snapshot is constructed.
archiveJsonWithPath now iterates the shared deduplicated collection directly,
so it no longer creates a LinkedHashMap for each archive call.
--
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]