cmccabe commented on code in PR #19586: URL: https://github.com/apache/kafka/pull/19586#discussion_r2080615754
########## metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetadataMetrics.java: ########## @@ -157,6 +215,46 @@ public void addToActiveBrokerCount(int brokerCountDelta) { public int activeBrokerCount() { return this.activeBrokerCount.get(); } + + public void setControlledShutdownBrokerCount(int brokerCount) { + this.controllerShutdownBrokerCount.set(brokerCount); + } + + public void addToControlledShutdownBrokerCount(int brokerCountDelta) { + this.controllerShutdownBrokerCount.addAndGet(brokerCountDelta); + } + + public int controlledShutdownBrokerCount() { + return this.controllerShutdownBrokerCount.get(); + } + + public void setBrokerRegistrationState(int brokerId, BrokerRegistration brokerRegistration) { + BrokerRegistrationState brokerState = getBrokerRegistrationState(brokerRegistration); + if (brokerRegistrationStates.containsKey(brokerId)) { + brokerRegistrationStates.get(brokerId).set(brokerState.state); + } else { + brokerRegistrationStates.put(brokerId, new AtomicInteger(brokerState.state)); + } + } + + private BrokerRegistrationState getBrokerRegistrationState(BrokerRegistration brokerRegistration) { Review Comment: We should move this function into the `BrokerRegistrationState` class -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org