rondagostino commented on a change in pull request #10113:
URL: https://github.com/apache/kafka/pull/10113#discussion_r574942006



##########
File path: core/src/main/scala/kafka/server/AutoTopicCreationManager.scala
##########
@@ -91,11 +91,14 @@ class DefaultAutoTopicCreationManager(
   config: KafkaConfig,
   metadataCache: MetadataCache,
   channelManager: Option[BrokerToControllerChannelManager],
-  adminManager: ZkAdminManager,
-  controller: KafkaController,
+  adminManager: Option[ZkAdminManager],
+  controller: Option[KafkaController],
   groupCoordinator: GroupCoordinator,
   txnCoordinator: TransactionCoordinator
 ) extends AutoTopicCreationManager with Logging {
+  if (controller.isEmpty && channelManager.isEmpty) {
+    throw new IllegalArgumentException("Must supply a channel manager if not 
supplying a controller")
+  }

Review comment:
       Yeah, actually a lot more checking could be done here since it's also 
`adminManager` that is optional.  We created `ZkSupport` and `RaftSupport` for 
`KafkaApis` and I thought that perhaps the same thing could be done here, but 
it felt like overkill.  These are not mutually exclusive, actually -- all three 
could be supplied when using ZooKeeper.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to