use of org.apache.tez.dag.app.dag.event.DAGEvent in project tez by apache.
the class TestDAGImpl method initDAG.
private void initDAG(DAGImpl impl) {
impl.handle(new DAGEvent(impl.getID(), DAGEventType.DAG_INIT));
Assert.assertEquals(DAGState.INITED, impl.getState());
}
use of org.apache.tez.dag.app.dag.event.DAGEvent in project tez by apache.
the class TestDAGImpl method testEdgeManager_GetNumSourceTaskPhysicalOutputs.
@SuppressWarnings("unchecked")
@Test(timeout = 5000)
public void testEdgeManager_GetNumSourceTaskPhysicalOutputs() {
setupDAGWithCustomEdge(ExceptionLocation.GetNumSourceTaskPhysicalOutputs);
dispatcher.getEventHandler().handle(new DAGEvent(dagWithCustomEdge.getID(), DAGEventType.DAG_INIT));
dispatcher.getEventHandler().handle(new DAGEventStartDag(dagWithCustomEdge.getID(), null));
dispatcher.await();
// After TEZ-1711, all task attempts of v1 fail which result in task fail, and finally
// dag failed.
Assert.assertEquals(DAGState.FAILED, dagWithCustomEdge.getState());
VertexImpl v1 = (VertexImpl) dagWithCustomEdge.getVertex("vertex1");
String diag = StringUtils.join(v1.getDiagnostics(), ",");
Assert.assertTrue(diag.contains(ExceptionLocation.GetNumSourceTaskPhysicalOutputs.name()));
}
use of org.apache.tez.dag.app.dag.event.DAGEvent in project tez by apache.
the class TestCommit method initDAG.
private void initDAG(DAGImpl dag) {
dag.handle(new DAGEvent(dag.getID(), DAGEventType.DAG_INIT));
Assert.assertEquals(DAGState.INITED, dag.getState());
}
use of org.apache.tez.dag.app.dag.event.DAGEvent in project tez by apache.
the class TestDAGImpl method testNonExistEdgeManagerPlugin.
@Test(timeout = 5000)
public void testNonExistEdgeManagerPlugin() {
dagPlan = createDAGWithNonExistEdgeManager();
dag = new DAGImpl(dagId, conf, dagPlan, dispatcher.getEventHandler(), taskCommunicatorManagerInterface, fsTokens, clock, "user", thh, appContext);
dag.entityUpdateTracker = new StateChangeNotifierForTest(dag);
doReturn(dag).when(appContext).getCurrentDAG();
dag.handle(new DAGEvent(dagId, DAGEventType.DAG_INIT));
Assert.assertEquals(DAGState.FAILED, dag.getState());
Assert.assertEquals(DAGTerminationCause.INIT_FAILURE, dag.getTerminationCause());
Assert.assertTrue(StringUtils.join(dag.getDiagnostics(), "").contains("java.lang.ClassNotFoundException: non-exist-edge-manager"));
}
use of org.apache.tez.dag.app.dag.event.DAGEvent in project tez by apache.
the class TestDAGImpl method testEdgeManager_GetNumDestinationConsumerTasks.
@SuppressWarnings("unchecked")
@Test(timeout = 5000)
public void testEdgeManager_GetNumDestinationConsumerTasks() {
setupDAGWithCustomEdge(ExceptionLocation.GetNumDestinationConsumerTasks);
dispatcher.getEventHandler().handle(new DAGEvent(dagWithCustomEdge.getID(), DAGEventType.DAG_INIT));
dispatcher.getEventHandler().handle(new DAGEventStartDag(dagWithCustomEdge.getID(), null));
dispatcher.await();
Assert.assertEquals(DAGState.RUNNING, dagWithCustomEdge.getState());
VertexImpl v1 = (VertexImpl) dagWithCustomEdge.getVertex("vertex1");
VertexImpl v2 = (VertexImpl) dagWithCustomEdge.getVertex("vertex2");
dispatcher.await();
Task t1 = v2.getTask(0);
TaskAttemptImpl ta1 = (TaskAttemptImpl) t1.getAttempt(TezTaskAttemptID.getInstance(t1.getTaskId(), 0));
InputReadErrorEvent ireEvent = InputReadErrorEvent.create("", 0, 0);
TezEvent tezEvent = new TezEvent(ireEvent, new EventMetaData(EventProducerConsumerType.INPUT, "vertex2", "vertex1", ta1.getID()));
dispatcher.getEventHandler().handle(new VertexEventRouteEvent(v2.getVertexId(), Lists.newArrayList(tezEvent)));
dispatcher.await();
//
Assert.assertEquals(VertexState.FAILED, v2.getState());
Assert.assertEquals(VertexState.KILLED, v1.getState());
String diag = StringUtils.join(v2.getDiagnostics(), ",");
Assert.assertTrue(diag.contains(ExceptionLocation.GetNumDestinationConsumerTasks.name()));
}
Aggregations