sarvekshayr commented on code in PR #9215:
URL: https://github.com/apache/ozone/pull/9215#discussion_r2488767405


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/ReconcileContainerCommandHandler.java:
##########
@@ -58,29 +54,25 @@ public SCMCommandProto.Type getCommandType() {
 
   @Override
   public int getQueuedCount() {
-    return this.metricsName == null ? 0 : (int) this.supervisor
-        .getReplicationQueuedCount(metricsName);
+    return (int) 
this.supervisor.getReplicationQueuedCount(ReconcileContainerTask.METRIC_NAME);
   }
 
   @Override
   public int getInvocationCount() {
-    return this.metricsName == null ? 0 : (int) this.supervisor
-        .getReplicationRequestCount(metricsName);
+    return (int) 
this.supervisor.getReplicationRequestCount(ReconcileContainerTask.METRIC_NAME);
   }
 
   @Override
   public long getAverageRunTime() {
-    return this.metricsName == null ? 0 : (int) this.supervisor
-        .getReplicationRequestAvgTime(metricsName);
+    return (int) 
this.supervisor.getReplicationRequestAvgTime(ReconcileContainerTask.METRIC_NAME);

Review Comment:
   Remove the (int) cast here as the method returns long.



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/ReconstructECContainersCommandHandler.java:
##########
@@ -72,26 +68,22 @@ public Type getCommandType() {
 
   @Override
   public int getInvocationCount() {
-    return this.metricsName == null ? 0 : (int) this.supervisor
-        .getReplicationRequestCount(metricsName);
+    return (int) 
this.supervisor.getReplicationRequestCount(ECReconstructionCoordinatorTask.METRIC_NAME);
   }
 
   @Override
   public long getAverageRunTime() {
-    return this.metricsName == null ? 0 : (int) this.supervisor
-        .getReplicationRequestAvgTime(metricsName);
+    return (int) 
this.supervisor.getReplicationRequestAvgTime(ECReconstructionCoordinatorTask.METRIC_NAME);

Review Comment:
   Remove the (int) cast here as well.



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/ReplicateContainerCommandHandler.java:
##########
@@ -103,19 +97,16 @@ public SCMCommandProto.Type getCommandType() {
 
   @Override
   public int getInvocationCount() {
-    return this.metricsName == null ? 0 : (int) this.supervisor
-        .getReplicationRequestCount(metricsName);
+    return (int) 
this.supervisor.getReplicationRequestCount(ReplicationTask.METRIC_NAME);
   }
 
   @Override
   public long getAverageRunTime() {
-    return this.metricsName == null ? 0 : (int) this.supervisor
-        .getReplicationRequestAvgTime(metricsName);
+    return (int) 
this.supervisor.getReplicationRequestAvgTime(ReplicationTask.METRIC_NAME);
   }

Review Comment:
   Remove the (int) cast here as well.



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