@Override
  protected void serviceStop() throws Exception {
    log.info("Stopping Kafka Server");
    serverStartable.shutdown();
    log.info("Kafka Server Stopped");
  }
This class has the hooks to start and stop single node kafka cluster.
itests/qtest-druid/src/main/java/org/apache/hive/kafka/SingleNodeKafkaCluster.java