dombizita commented on code in PR #6535:
URL: https://github.com/apache/ozone/pull/6535#discussion_r1618742250


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -144,20 +145,19 @@ export class DiskUsage extends 
React.Component<Record<string, object>, IDUState>
       const dataSize = duResponse.size;
       let subpaths: IDUSubpath[] = duResponse.subPaths;
 
-      subpaths.sort((a, b) => (a.size < b.size) ? 1 : -1);
-
-      // Only show top n blocks with the most DU,
-      // other blocks are merged as a single block
-      if (subpaths.length > limit) {
+      // This logic is for other objects for Max Limit 30 we are calculating 
+      // Other Object Size = Total Size - Sum of all subpaths Size
+      if (subpaths.length >= limit || (subpaths.length > 0 && limit === 
MAX_DISPLAY_LIMIT)) {

Review Comment:
   In your example the `subpaths.length` is 10. In that case the sum of that 
can't be less, than the total. The subpaths's size is either the total size or 
if we have 30 subpaths, we have the chance that we have more subpaths, in that 
case we need to sum them up and subtract it from the total size. 
   
   If the `subpaths.length` is not the maximum limit, than we won't need other 
objects, unless the limit is less than the number of subpaths. 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to