use of org.apache.tez.dag.app.dag.event.DAGEventVertexReRunning in project tez by apache.
the class TestDAGImpl method testGroupDAGWithVertexReRunning.
@SuppressWarnings("unchecked")
@Test(timeout = 5000)
public void testGroupDAGWithVertexReRunning() {
groupDag.getConf().setBoolean(TezConfiguration.TEZ_AM_COMMIT_ALL_OUTPUTS_ON_DAG_SUCCESS, false);
initDAG(groupDag);
startDAG(groupDag);
dispatcher.await();
Vertex v1 = groupDag.getVertex("vertex1");
Vertex v2 = groupDag.getVertex("vertex2");
dispatcher.getEventHandler().handle(new DAGEventVertexCompleted(v1.getVertexId(), VertexState.SUCCEEDED));
dispatcher.getEventHandler().handle(new DAGEventVertexReRunning(v1.getVertexId()));
dispatcher.getEventHandler().handle(new DAGEventVertexCompleted(v2.getVertexId(), VertexState.SUCCEEDED));
dispatcher.await();
// commit should not happen due to vertex-rerunning
Assert.assertEquals(0, TotalCountingOutputCommitter.totalCommitCounter);
dispatcher.getEventHandler().handle(new DAGEventVertexCompleted(v1.getVertexId(), VertexState.SUCCEEDED));
dispatcher.await();
// commit happen
Assert.assertEquals(1, TotalCountingOutputCommitter.totalCommitCounter);
Assert.assertEquals(2, groupDag.getSuccessfulVertices());
}
use of org.apache.tez.dag.app.dag.event.DAGEventVertexReRunning in project tez by apache.
the class TestDAGImpl method testGroupDAGWithVertexReRunningAfterCommit.
@SuppressWarnings("unchecked")
@Test(timeout = 5000)
public void testGroupDAGWithVertexReRunningAfterCommit() {
groupDag.getConf().setBoolean(TezConfiguration.TEZ_AM_COMMIT_ALL_OUTPUTS_ON_DAG_SUCCESS, false);
initDAG(groupDag);
startDAG(groupDag);
dispatcher.await();
Vertex v1 = groupDag.getVertex("vertex1");
Vertex v2 = groupDag.getVertex("vertex2");
dispatcher.getEventHandler().handle(new DAGEventVertexCompleted(v1.getVertexId(), VertexState.SUCCEEDED));
dispatcher.getEventHandler().handle(new DAGEventVertexCompleted(v2.getVertexId(), VertexState.SUCCEEDED));
dispatcher.await();
// vertex group commit happens
Assert.assertEquals(1, TotalCountingOutputCommitter.totalCommitCounter);
// dag failed when vertex re-run happens after vertex group commit is done.
dispatcher.getEventHandler().handle(new DAGEventVertexReRunning(v1.getVertexId()));
dispatcher.await();
Assert.assertEquals(DAGState.FAILED, groupDag.getState());
Assert.assertEquals(DAGTerminationCause.VERTEX_RERUN_AFTER_COMMIT, groupDag.getTerminationCause());
}
Aggregations