private void init(Class<?> cls) {
    initDataDir(cls);
    LOG.info("Using test data dir (class: {}): {}", cls.getName(), testDataDir);
    // HIVE_USER_INSTALL_DIR is required in DagUtils, let's set one
    Path installDir = Paths.get(System.getProperty("test.tmp.dir"), "user_install_dir");
    setValue(HiveConf.ConfVars.HIVE_USER_INSTALL_DIR.varname, installDir.toString());
    // to avoid the overhead of starting a tez session when creating a new SessionState
    // many unit tests don't need actual tez execution, and this can save a lot of time
    setValue(HiveConf.ConfVars.HIVE_CLI_TEZ_INITIALIZE_SESSION.varname, "false");
    // to avoid the overhead of using a real yarn cluster for unit tests.
    setValue("tez.local.mode", "true");
    // to avoid the overhead of starting an RPC server of the local DAGAppMaster
    setValue("tez.local.mode.without.network", "true");
    // tests might assume this is set
    setValue("hive.in.tez.test", "true");
    // to prevent polluting the git tree with local tez cache folders (like tez-local-cache136810858646778831)
    setValue("tez.local.cache.root.folder", System.getProperty("build.dir"));
    // prevent RecoveryService from starting, which is not needed in unit tests
    setValue("tez.dag.recovery.enabled", "false");
    // as Query History Service is enabled by default, it might add overhead to tests, it's not worth using it
    // dedicated unit tests are supposed to check that service as much as possible
    setValue(HiveConf.ConfVars.HIVE_QUERY_HISTORY_ENABLED.varname, "false");
  }
This class is mostly used in unit test environment to prevent polluting the
original HiveConf, and also to provide a way to set some default values for execution.
common/src/test/org/apache/hadoop/hive/conf/HiveConfForTest.java