sreejasahithi commented on code in PR #10177:
URL: https://github.com/apache/ozone/pull/10177#discussion_r3179333765


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/StorageDistributionEndpoint.java:
##########
@@ -190,35 +198,49 @@ public Response downloadDataNodeStorageDistribution() {
     List<String> headers = Arrays.asList(
         "HostName",
         "Datanode UUID",
-        "Filesystem Capacity",
-        "Filesystem Used Space",
-        "Filesystem Remaining Space",
-        "Ozone Capacity",
-        "Ozone Used Space",
-        "Ozone Remaining Space",
-        "PreAllocated Container Space",
-        "Reserved Space",
-        "Minimum Free Space",
-        "Pending Block Size"
+        "Filesystem Capacity (GB)",
+        "Filesystem Used Space (GB)",
+        "Filesystem Remaining Space (GB)",
+        "Ozone Capacity (GB)",
+        "Ozone Used Space (GB)",
+        "Ozone Remaining Space (GB)",
+        "PreAllocated Container Space (GB)",
+        "Reserved Space (GB)",
+        "Minimum Free Space (GB)",
+        "Pending Block Size (GB)"
     );
 
     List<Function<DataNodeStoragePendingDeletionView, Object>> columns =
         Arrays.asList(
             v -> v.getMetric() != null ? v.getMetric().getHostName() : 
"Unknown",
             v -> v.getMetric() != null ? v.getMetric().getDatanodeUuid() : 
"Unknown",
-            v -> v.getReport() != null ? v.getReport().getFilesystemCapacity() 
: -1,
-            v -> v.getReport() != null ? v.getReport().getFilesystemUsed() : 
-1,
-            v -> v.getReport() != null ? 
v.getReport().getFilesystemAvailable() : -1,
-            v -> v.getReport() != null ? v.getReport().getCapacity() : -1,
-            v -> v.getReport() != null ? v.getReport().getUsed() : -1,
-            v -> v.getReport() != null ? v.getReport().getRemaining() : -1,
-            v -> v.getReport() != null ? v.getReport().getCommitted() : -1,
-            v -> v.getReport() != null ? v.getReport().getReserved() : -1,
-            v -> v.getReport() != null ? v.getReport().getMinimumFreeSpace() : 
-1,
-            v -> v.getReport() != null ? v.getMetric().getPendingBlockSize() : 
-1
+            v -> v.getReport() != null ? 
formatBytesToGB(v.getReport().getFilesystemCapacity()) : -1,
+            v -> v.getReport() != null ? 
formatBytesToGB(v.getReport().getFilesystemUsed()) : -1,
+            v -> v.getReport() != null ? 
formatBytesToGB(v.getReport().getFilesystemAvailable()) : -1,
+            v -> v.getReport() != null ? 
formatBytesToGB(v.getReport().getCapacity()) : -1,
+            v -> v.getReport() != null ? 
formatBytesToGB(v.getReport().getUsed()) : -1,
+            v -> v.getReport() != null ? 
formatBytesToGB(v.getReport().getRemaining()) : -1,
+            v -> v.getReport() != null ? 
formatBytesToGB(v.getReport().getCommitted()) : -1,
+            v -> v.getReport() != null ? 
formatBytesToGB(v.getReport().getReserved()) : -1,
+            v -> v.getReport() != null ? 
formatBytesToGB(v.getReport().getMinimumFreeSpace()) : -1,
+            v -> v.getReport() != null ? 
formatBytesToGB(v.getMetric().getPendingBlockSize()) : -1

Review Comment:
   Here for getting PendingBlockSize it would be better if add a guard for 
v.getMetric() != null since we are reading the value form the metric.



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