jeffkbkim commented on code in PR #14387:
URL: https://github.com/apache/kafka/pull/14387#discussion_r1384082333


##########
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:
   The GroupCoordinatorShard is built in CoordinatorRuntime and we don't know 
which type of CoordinatorMetrics is passed into it. Once we know we're building 
a GroupCoordinatorShard, only then we can verify the type



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

Reply via email to