public MiniTezShim(Configuration conf, int numberOfTaskTrackers, String nameNode)
     throws IOException {
   mr = new MiniTezCluster("hive", numberOfTaskTrackers);
   conf.set("fs.defaultFS", nameNode);
   conf.set("tez.am.log.level", "DEBUG");
   conf.set(MRJobConfig.MR_AM_STAGING_DIR, "/apps_staging_dir");
   mr.init(conf);
   mr.start();
   this.conf = mr.getConfig();
 }
    @Override
    public void setupConfiguration(Configuration conf) {
      Configuration config = mr.getConfig();
      for (Map.Entry<String, String> pair : config) {
        conf.set(pair.getKey(), pair.getValue());
      }

      Path jarPath = new Path("hdfs:///user/hive");
      Path hdfsPath = new Path("hdfs:///user/");
      try {
        FileSystem fs = cluster.getFileSystem();
        jarPath = fs.makeQualified(jarPath);
        conf.set("hive.jar.directory", jarPath.toString());
        fs.mkdirs(jarPath);
        hdfsPath = fs.makeQualified(hdfsPath);
        conf.set("hive.user.install.directory", hdfsPath.toString());
        fs.mkdirs(hdfsPath);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }