jolshan commented on code in PR #14387: URL: https://github.com/apache/kafka/pull/14387#discussion_r1382183515
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorShard.java: ########## @@ -160,11 +161,14 @@ public GroupCoordinatorShard build() { if (timer == null) throw new IllegalArgumentException("Timer must be set."); if (coordinatorMetrics == null) - throw new IllegalArgumentException("CoordinatorMetricsShard must be set."); + throw new IllegalArgumentException("CoordinatorMetrics must be set."); if (topicPartition == null) throw new IllegalArgumentException("TopicPartition must be set."); CoordinatorMetricsShard metricsShard = coordinatorMetrics.newMetricsShard(snapshotRegistry, topicPartition); + if (!(metricsShard instanceof GroupCoordinatorMetricsShard)) Review Comment: really minor -- but since the passed in CoordinatorMetrics determines the type of the shard, does it make more sense to check CoordinatorMetrics is of type GroupCoordinatorMetrics and make the error thrown there. -- 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