dombizita commented on code in PR #6801:
URL: https://github.com/apache/ozone/pull/6801#discussion_r1644409878
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -63,6 +65,7 @@ let cancelPieSignal: AbortController
let cancelSummarySignal: AbortController
let cancelQuotaSignal: AbortController;
let cancelKeyMetadataSignal: AbortController;
+let normalizedValues: number[]=[];
Review Comment:
nit
```suggestion
let normalizedValues: number[] = [];
```
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -185,9 +188,21 @@ export class DiskUsage extends
React.Component<Record<string, object>, IDUState>
return (subpath.isKey || subpathName === OTHER_PATH_NAME) ?
subpathName : subpathName + '/';
});
- values = subpaths.map(subpath => {
- return subpath.size / dataSize;
- });
+ // To avoid NaN Condition NaN will get divide by Zero to avoid map
iterations
+ if (dataSize > 0) {
+ values = subpaths.map(subpath => {
+ return subpath.size / dataSize;
+ });
+ }
Review Comment:
Did this cause problems before? I don't see how is this related to you
change, as you didn't change anything with the `dataSize` variable, before this
part.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/diskUsage/diskUsage.tsx:
##########
@@ -197,7 +212,7 @@ export class DiskUsage extends
React.Component<Record<string, object>, IDUState>
return byteToSize(subpath.size, 1);
});
}
-
+
Review Comment:
nit: unrelated change
--
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]