You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/05/22 19:07:40 UTC

[GitHub] [kafka] gnkoshelev commented on pull request #8715: KAFKA-10033: AdminClient should throw UnknownTopicOrPartitionException instead of UnknownServerException if altering configs of non-existing topic

gnkoshelev commented on pull request #8715:
URL: https://github.com/apache/kafka/pull/8715#issuecomment-632864284


   Hi @bdbyrne,
   If so what do you say to
   ```
   def validateTopicCreate(topic: String,
                             partitionReplicaAssignment: Map[Int, Seq[Int]],
                             config: Properties): Unit = {
     /* ... */
     if (zkClient.topicExists(topic))
           throw new TopicExistsException(s"Topic '$topic' already exists.")
     /* ... */
   }
   ```
   or
   ```
     def deleteTopic(topic: String): Unit = {
       if (zkClient.topicExists(topic)) {
         /* ... */
       } else {
         throw new UnknownTopicOrPartitionException(s"Topic `$topic` to delete does not exist")
       }
     }
   ```
   ?  
   
   
   It seems to me that the `AdminZkClient.validateTopicConfig` should throw as specific exception as possible. Also, it preserves current style as in the examples above. 


----------------------------------------------------------------
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:
users@infra.apache.org