jolshan commented on code in PR #14090: URL: https://github.com/apache/kafka/pull/14090#discussion_r1274109070
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/runtime/CoordinatorRuntime.java: ########## @@ -1053,50 +1066,80 @@ private void enqueue(CoordinatorEvent event) { } /** - * @return The coordinator context if the coordinator is active or an exception otherwise. + * Creates the context if it does not exist. + * + * @param tp The topic partition. + */ + private void maybeCreateContext(TopicPartition tp) { + coordinators.computeIfAbsent(tp, CoordinatorContext::new); + } + + /** + * @return The coordinator context or thrown an exception if it does + * not exist. * @throws NotCoordinatorException - * @throws CoordinatorLoadInProgressException + * Package private for testing. Review Comment: Ah I see the method is below -- this view of the changes was tricky for me to understand but I see now. ########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/runtime/CoordinatorRuntime.java: ########## @@ -1053,50 +1066,80 @@ private void enqueue(CoordinatorEvent event) { } /** - * @return The coordinator context if the coordinator is active or an exception otherwise. + * Creates the context if it does not exist. + * + * @param tp The topic partition. + */ + private void maybeCreateContext(TopicPartition tp) { + coordinators.computeIfAbsent(tp, CoordinatorContext::new); + } + + /** + * @return The coordinator context or thrown an exception if it does + * not exist. * @throws NotCoordinatorException - * @throws CoordinatorLoadInProgressException + * Package private for testing. Review Comment: Ah I see the old method is below -- this view of the changes was tricky for me to understand but I see now. -- 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