use of org.apache.tez.dag.api.client.DAGStatus in project tez by apache.
the class TestAnalyzer method runDAG.
private void runDAG(DAG dag, DAGStatus.State finalState) throws Exception {
tezSession.waitTillReady();
LOG.info("ABC Running DAG name: " + dag.getName());
DAGClient dagClient = tezSession.submitDAG(dag);
DAGStatus dagStatus = dagClient.getDAGStatus(null);
while (!dagStatus.isCompleted()) {
LOG.info("Waiting for dag to complete. Sleeping for 500ms." + " DAG name: " + dag.getName() + " DAG appContext: " + dagClient.getExecutionContext() + " Current state: " + dagStatus.getState());
Thread.sleep(100);
dagStatus = dagClient.getDAGStatus(null);
}
Assert.assertEquals(finalState, dagStatus.getState());
}
use of org.apache.tez.dag.api.client.DAGStatus in project tez by apache.
the class DAGClientAMProtocolBlockingPBServerImpl method getDAGStatus.
@Override
public GetDAGStatusResponseProto getDAGStatus(RpcController controller, GetDAGStatusRequestProto request) throws ServiceException {
UserGroupInformation user = getRPCUser();
try {
String dagId = request.getDagId();
long timeout = request.getTimeout();
if (!real.getACLManager(dagId).checkDAGViewAccess(user)) {
throw new AccessControlException("User " + user + " cannot perform DAG view operation");
}
real.updateLastHeartbeatTime();
DAGStatus status;
status = real.getDAGStatus(dagId, DagTypeConverters.convertStatusGetOptsFromProto(request.getStatusOptionsList()), timeout);
assert status instanceof DAGStatusBuilder;
DAGStatusBuilder builder = (DAGStatusBuilder) status;
return GetDAGStatusResponseProto.newBuilder().setDagStatus(builder.getProto()).build();
} catch (TezException e) {
throw wrapException(e);
}
}
Aggregations