TezClient tezClient = new TezClient(tezConf);
DAGClient dagClient = null;
TezSession tezSession = null;
boolean reuseSession = reUseTezSession != null;
TezSessionConfiguration tezSessionConfig;
AMConfiguration amConfig = new AMConfiguration(
commonEnv, amLocalResources,
tezConf, null);
if(!dagViaRPC) {
// TODO Use utility method post TEZ-205 to figure out AM arguments etc.
dagClient = tezClient.submitDAGApplication(dag, amConfig);
} else {
if (reuseSession) {
tezSession = reUseTezSession;
} else {
tezSessionConfig = new TezSessionConfiguration(amConfig, tezConf);
tezSession = new TezSession("testsession", tezSessionConfig);
tezSession.start();
}
}