priyeshkaratha commented on code in PR #9681:
URL: https://github.com/apache/ozone/pull/9681#discussion_r2814953126


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/StorageDistributionEndpoint.java:
##########
@@ -114,6 +128,85 @@ public Response getStorageDistribution() {
     }
   }
 
+  @GET
+  @Path("/download")
+  public Response downloadDataNodeDistribution() {
+    DataNodeMetricsServiceResponse metricsResponse =
+        dataNodeMetricsService.getCollectedMetrics(null);
+
+    if (metricsResponse.getStatus() != 
DataNodeMetricsService.MetricCollectionStatus.FINISHED) {
+      return Response.status(Response.Status.ACCEPTED)
+          .entity(metricsResponse)
+          .type(MediaType.APPLICATION_JSON)
+          .build();
+    }
+
+    List<DatanodePendingDeletionMetrics> pendingDeletionMetrics =
+        metricsResponse.getPendingDeletionPerDataNode();
+
+    if (pendingDeletionMetrics == null) {
+      return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
+          .entity("Metrics data is missing despite FINISHED status.")
+          .type(MediaType.TEXT_PLAIN)
+          .build();
+    }
+
+    Map<String, DatanodeStorageReport> reportByUuid =
+        collectDatanodeReports().stream()

Review Comment:
   nodeManager.getNodeStat() and nodeManager.getTotalFilesystemUsage() this 
call will happen inside recon right? So will it create any impact?
   



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