himanish-star commented on code in PR #15511:
URL: https://github.com/apache/pinot/pull/15511#discussion_r2037840468


##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -63,7 +64,10 @@ export const RebalanceServerStatusOp = (
                 if (jobs.error) {
                     return;
                 }
-                setRebalanceServerJobs(jobs as RebalanceTableSegmentJobs)
+                const sortedJobs: RebalanceTableSegmentJob[] = 
Object.keys(jobs as RebalanceTableSegmentJobs)
+                    .map(jobId => jobs[jobId] as RebalanceTableSegmentJob)
+                    .sort((j1, j2) => j1.submissionTimeMs < 
j2.submissionTimeMs ? 1 : -1);
+                setRebalanceServerJobs(sortedJobs);

Review Comment:
   It's difficult to do inside `axios` function as the same axios function is 
being used by other code components and the axios returns an object with job 
information as key & object pairs. That's the reason why I'm flattening it here 
into an array and then sorting it



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to