hawk9821 commented on code in PR #9951:
URL: https://github.com/apache/seatunnel/pull/9951#discussion_r2471838369


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/service/JobInfoService.java:
##########
@@ -134,6 +134,13 @@ public JsonArray getRunningJobsJson() {
                 
nodeEngine.getHazelcastInstance().getMap(Constant.IMAP_RUNNING_JOB_INFO);
         return values.entrySet().stream()
                 .map(jobInfoEntry -> convertToJson(jobInfoEntry.getValue(), 
jobInfoEntry.getKey()))
+                .sorted(

Review Comment:
   JobId is ordered, I think it can be sorted by jobId, compared to higher 
efficiency.
   ```
   return values.entrySet().stream()
             .sorted(Map.Entry.comparingByKey(Comparator.reverseOrder()))
             .map(jobInfoEntry -> convertToJson(jobInfoEntry.getValue(), 
jobInfoEntry.getKey()))
             .collect(JsonArray::new, JsonArray::add, JsonArray::add);
   ```



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