DomGarguilo commented on code in PR #6080:
URL: https://github.com/apache/accumulo/pull/6080#discussion_r2737910482
##########
server/manager/src/main/java/org/apache/accumulo/manager/metrics/ManagerMetrics.java:
##########
@@ -53,6 +55,24 @@ public class ManagerMetrics implements MetricsProducer {
private final AtomicLong metadataTGWErrorsGauge = new AtomicLong(0);
private final AtomicLong userTGWErrorsGauge = new AtomicLong(0);
private final AtomicInteger compactionConfigurationError = new
AtomicInteger(0);
+ private final AtomicInteger goalState = new AtomicInteger(0);
+
+ public void updateManagerGoalState(ManagerGoalState goal) {
+ switch (goal) {
+ case CLEAN_STOP:
+ goalState.set(0);
+ break;
+ case NORMAL:
+ goalState.set(2);
+ break;
+ case SAFE_MODE:
+ goalState.set(1);
+ break;
+ default:
+ goalState.set(-1);
+ throw new IllegalStateException("Unhandled manager goal state: " +
goal);
+ }
+ }
Review Comment:
```suggestion
private final AtomicInteger managerGoalState = new AtomicInteger(-1);
public void updateManagerGoalState(ManagerGoalState goal) {
int newValue = switch (goal) {
case CLEAN_STOP -> 0;
case SAFE_MODE -> 1;
case NORMAL -> 2;
};
managerGoalState.set(newValue);
}
```
--
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]