dlmarion commented on code in PR #6080:
URL: https://github.com/apache/accumulo/pull/6080#discussion_r2738099029


##########
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:
   Ok, I see. I missed that it was initialized to -1. Compile time checking is 
good too.



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

Reply via email to