show topic partition info

This commit is contained in:
许晓东
2021-09-23 20:20:52 +08:00
parent 71dda5e432
commit e65eba9237
9 changed files with 203 additions and 5 deletions

View File

@@ -56,6 +56,12 @@ class TopicConsole(config: KafkaConfig) extends KafkaConsole(config: KafkaConfig
}
}
/**
* delete topic by topic name.
*
* @param topic topic name.
* @return result or : fail message.
*/
def deleteTopic(topic: String): (Boolean, String) = {
withAdminClientAndCatchError(admin => {
admin.deleteTopics(Collections.singleton(topic), new DeleteTopicsOptions().retryOnQuotaViolation(false)).all().get(timeoutMs, TimeUnit.MILLISECONDS)