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


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/DataNodeMetricsService.java:
##########
@@ -294,16 +300,23 @@ private void resetState() {
     totalNodesFailed = 0;
   }
 
-  public DataNodeMetricsServiceResponse getCollectedMetrics() {
+  public DataNodeMetricsServiceResponse getCollectedMetrics(int limit) {
     startTask();
     if (currentStatus == MetricCollectionStatus.FINISHED) {
-      return DataNodeMetricsServiceResponse.newBuilder()
+      DataNodeMetricsServiceResponse.Builder dnMetricsBuilder = 
DataNodeMetricsServiceResponse.newBuilder();
+      dnMetricsBuilder
           .setStatus(currentStatus)
-          .setPendingDeletion(pendingDeletionList)
           .setTotalPendingDeletionSize(totalPendingDeletion)
           .setTotalNodesQueried(totalNodesQueried)
-          .setTotalNodeQueryFailures(totalNodesFailed)
-          .build();
+          .setTotalNodeQueryFailures(totalNodesFailed);
+
+      if (limit < 0) {

Review Comment:
   I think we should return 400 error for limit < 0 which is more meaningful. 
if we didn't pass limit it should return full data.



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