devmadhuu commented on code in PR #12178:
URL: https://github.com/apache/ozone/pull/12178#discussion_r4781509123
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerMetrics.java:
##########
@@ -194,34 +203,15 @@ public long
getNumContainerMovesCompletedInLatestIteration() {
public void incrementCurrentIterationContainerMoveMetric(
MoveManager.MoveResult result, long valueToAdd) {
- if (result == null) {
- return;
- }
- switch (result) {
+ // TODO: Add metrics for other errors that need to be tracked.
+ switch (ContainerBalancerStorageTypeMetrics.Outcome.of(result)) {
case COMPLETED:
this.numContainerMovesCompletedInLatestIteration.incr(valueToAdd);
break;
- case REPLICATION_FAIL_TIME_OUT:
- case DELETION_FAIL_TIME_OUT:
+ case TIMEOUT:
this.numContainerMovesTimeoutInLatestIteration.incr(valueToAdd);
break;
- // TODO: Add metrics for other errors that need to be tracked.
- case FAIL_LEADER_NOT_READY:
- case REPLICATION_FAIL_INFLIGHT_REPLICATION:
- case REPLICATION_FAIL_NOT_EXIST_IN_SOURCE:
- case REPLICATION_FAIL_STORAGE_TYPE_MISMATCH:
- case REPLICATION_FAIL_EXIST_IN_TARGET:
- case REPLICATION_FAIL_CONTAINER_NOT_CLOSED:
- case REPLICATION_FAIL_INFLIGHT_DELETION:
- case REPLICATION_FAIL_NODE_NOT_IN_SERVICE:
- case DELETION_FAIL_NODE_NOT_IN_SERVICE:
- case REPLICATION_FAIL_NODE_UNHEALTHY:
- case DELETION_FAIL_NODE_UNHEALTHY:
- case DELETE_FAIL_POLICY:
- case REPLICATION_NOT_HEALTHY_BEFORE_MOVE:
- case REPLICATION_NOT_HEALTHY_AFTER_MOVE:
- case FAIL_CONTAINER_ALREADY_BEING_MOVED:
- case FAIL_UNEXPECTED_ERROR:
+ case FAILED:
Review Comment:
Agreed, I'll split it. I'll land a small refactor PR first that extracts the
`MoveManager.MoveResult → Outcome` classification into one place (the Outcome
enum + Outcome.of(...)) and repoints
`ContainerBalancerMetrics.incrementCurrentIterationContainerMoveMetric `to it —
no change to what the existing counters record, existing tests stay green. Once
that merges, I'll rebase this PR to add only the new per-storage-type counters
on top, so this one is scoped to the metrics and the result-to-outcome mapping
lives in a single place. Refactor PR: #12231
--
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]