TezClient tezClient = new TezClient(tezConf);
AMConfiguration amConf = new AMConfiguration(new HashMap<String, String>(),
new HashMap<String, LocalResource>(), tezConf, null);
DAGClient dagClient = tezClient.submitDAGApplication(dag, amConf);
DAGStatus dagStatus = dagClient.getDAGStatus(null);
while (!dagStatus.isCompleted()) {
LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: "
+ dagStatus.getState());