C0urante commented on a change in pull request #8828: URL: https://github.com/apache/kafka/pull/8828#discussion_r438303698
########## File path: connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.java ########## @@ -375,6 +383,152 @@ public boolean createTopic(NewTopic topic) { return existingTopics; } + /** + * Verify the named topic uses only compaction for the cleanup policy. + * + * @param topic the name of the topic + * @param workerTopicConfig the name of the worker configuration that specifies the topic name + * @return true if the admin client could be used to verify the topic setting, or false if + * the verification could not be performed, likely because the admin client principal + * did not have the required permissions or because the broker was older than 0.11.0.0 + * @throws ConfigException if the actual topic setting did not match the required setting + */ + public boolean verifyTopicCleanupPolicyOnlyCompact(String topic, String workerTopicConfig, + String topicPurpose) { + Set<String> cleanupPolicies = topicCleanupPolicy(topic); + if (cleanupPolicies == null || cleanupPolicies.isEmpty()) { Review comment: No kidding... I assumed it was possible to create topics without cleanup policies but it looks like you're right. My bad! ---------------------------------------------------------------- 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