devmadhuu opened a new pull request, #12231:
URL: https://github.com/apache/ozone/pull/12231

   What changes were proposed in this pull request?
   
   `ContainerBalancerMetrics.incrementCurrentIterationContainerMoveMetric` 
classifies each `MoveManager.MoveResult` into one of three buckets (completed / 
timeout / failed) with an inline switch. An upcoming change (HDDS-17590) needs 
the same classification to drive per-storage-type move counters. Rather than 
duplicate the switch in a second class, this PR extracts the classification 
into a single reusable place.
   
   This is a behavior-neutral refactor. No metric values change.
   
   - Add a nested public enum Outcome { COMPLETED, TIMEOUT, FAILED, NONE } to 
`ContainerBalancerMetrics`, with a static `Outcome.of(MoveManager.MoveResult)` 
that mirrors the existing switch exactly: `COMPLETED → COMPLETED`; 
REPLICATION_FAIL_TIME_OUT and DELETION_FAIL_TIME_OUT → TIMEOUT; every other 
known result → FAILED; null or any future/unhandled result → NONE (not counted, 
same as the old default).
   - Rewire `incrementCurrentIterationContainerMoveMetric` to route through 
Outcome.of(result). It increments the same three counters as before and is a 
no-op for null/NONE.
   
   The classification stays in `ContainerBalancerMetrics`, the class that 
already owns it. HDDS-17590 will then reuse 
`ContainerBalancerMetrics.Outcome.of(...)` instead of adding its own copy.
   
   What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17995
   
   How was this patch tested?
   
   New unit test `TestContainerBalancerMetrics`


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