public void shutDown() throws Exception {
    if (clusterType.getCoreClusterType() == CoreClusterType.TEZ
        && SessionState.get().getTezSession() != null) {
      SessionState.get().getTezSession().destroy();
    }

    if (druidCluster != null) {
      druidCluster.stop();
      druidCluster = null;
    }

    if (kafkaCluster != null) {
      kafkaCluster.stop();
      kafkaCluster = null;
    }
    setup.tearDown();
    if (mr != null) {
      mr.shutdown();
      mr = null;
    }
    FileSystem.closeAll();
    if (dfs != null) {
      dfs.shutdown();
      dfs = null;
    }
  }
QTestSetup defines test fixtures which are reused across testcases, and are needed before any
test can be run
itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestMiniClusters.java