private void waitTopicCreated(String name, KafkaFuture<Void> future) {
        try {
            future.get();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        } catch (ExecutionException e) {
            if (e.getCause() instanceof TopicExistsException) {
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.debug("Topic already exists. name={}", name);
                }
            } else {
                LOGGER.error("Failed to create topic. name={}", name, e);
                throw new RuntimeException(e);
            }
        }
    }
Wait until the topic is created, or throw an exception if it fails.
Note: It is okay if the topic already exists.
tools/src/main/java/org/apache/kafka/tools/automq/perf/TopicService.java