use of org.apache.tez.dag.app.dag.event.DAGEventStartDag in project tez by apache.
the class TestDAGImpl method testInvalidEvent.
@SuppressWarnings("unchecked")
@Test(timeout = 5000)
public void testInvalidEvent() {
dispatcher.getEventHandler().handle(new DAGEventStartDag(dagId, null));
dispatcher.await();
Assert.assertEquals(DAGState.ERROR, dag.getState());
}
use of org.apache.tez.dag.app.dag.event.DAGEventStartDag in project tez by apache.
the class DAGAppMaster method startDAGExecution.
private void startDAGExecution(DAG dag, final Map<String, LocalResource> additionalAmResources) throws TezException {
currentDAG = dag;
// Try localizing the actual resources.
List<URL> additionalUrlsForClasspath;
try {
additionalUrlsForClasspath = dag.getDagUGI().doAs(new PrivilegedExceptionAction<List<URL>>() {
@Override
public List<URL> run() throws Exception {
return processAdditionalResources(currentDAG.getID(), additionalAmResources);
}
});
} catch (IOException e) {
throw new TezException(e);
} catch (InterruptedException e) {
throw new TezException(e);
}
dagIDs.add(currentDAG.getID().toString());
// End of creating the job.
((RunningAppContext) context).setDAG(currentDAG);
// Send out an event to inform components that a new DAG has been submitted.
// Information about this DAG is available via the context.
sendEvent(new DAGAppMasterEvent(DAGAppMasterEventType.NEW_DAG_SUBMITTED));
// create a job event for job initialization
DAGEvent initDagEvent = new DAGEvent(currentDAG.getID(), DAGEventType.DAG_INIT);
// Send init to the job (this does NOT trigger job execution)
// This is a synchronous call, not an event through dispatcher. We want
// job-init to be done completely here.
dagEventDispatcher.handle(initDagEvent);
// All components have started, start the job.
/**
* create a job-start event to get this ball rolling
*/
DAGEvent startDagEvent = new DAGEventStartDag(currentDAG.getID(), additionalUrlsForClasspath);
/**
* send the job-start event. this triggers the job execution.
*/
sendEvent(startDagEvent);
}
Aggregations