public void createTopicWithData(String topic, List<byte []> events) {
    createTopic(topic);
    // set up kafka producer
    Properties properties = new Properties();
    properties.put("bootstrap.servers", kafkaServer);
    properties.put("acks", "1");
    properties.put("retries", "3");

    try(KafkaProducer<byte[], byte[]> producer = new KafkaProducer<>(
        properties,
        new ByteArraySerializer(),
        new ByteArraySerializer()
    )){
      // 1534736225090 -> 08/19/2018 20:37:05
      IntStream.range(0, events.size())
          .mapToObj(i -> new ProducerRecord<>(topic,
              0,
              // 1534736225090 -> Mon Aug 20 2018 03:37:05
              1534736225090L + 1000 * 3600 * i,
              ("key-" + i).getBytes(),
              events.get(i)))
          .forEach(r -> producer.send(r));
    }
  }
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