示例#1
0
 public void createTopic(
     String topic, int numPartitions, int replicationFactor, Properties topicConfig) {
   if (!AdminUtils.topicExists(server.zkClient(), topic)) {
     AdminUtils.createTopic(
         server.zkClient(), topic, numPartitions, replicationFactor, topicConfig);
     awaitPropagation(topic, 0, 2000l);
   }
 }
示例#2
0
 public boolean isTopicAvailable() {
   return AdminUtils.topicExists(zkClient, topicName);
 }