private void createTopic(String topic) {
    Properties properties = new Properties();
    properties.setProperty("bootstrap.servers", "localhost:9092");
    properties.setProperty("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
    properties.setProperty("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");

    int numPartitions = 1;
    short replicationFactor = 1;
    AdminClient adminClient = AdminClient.create(properties);
    NewTopic newTopic = new NewTopic(topic, numPartitions, replicationFactor);

    adminClient.createTopics(Collections.singletonList(newTopic));
    adminClient.close();
  }
Creates a topic and inserts data from the specified datafile.
Each line in the datafile is sent to kafka as a single message.
@param topicName
@param datafile
itests/qtest-druid/src/main/java/org/apache/hive/kafka/SingleNodeKafkaCluster.java