sreejasahithi commented on code in PR #9215:
URL: https://github.com/apache/ozone/pull/9215#discussion_r2493211609
##########
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);
Review Comment:
This PR replaces the previous approach where handlers needed a task instance
to call task.getMetricName(). Instead, I am using static constants from the
task classes (TaskClass.METRIC_NAME) so handlers can get metric names without
requiring a task instance or null checks. The constants are defined once in
each task class and referenced by their respective handlers, eliminating the
null checks.
--
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]