Search in sources :

Example 6 with VertexEventTermination

use of org.apache.tez.dag.app.dag.event.VertexEventTermination in project tez by apache.

the class TestVertexImpl method testTerminatingVertexForVComplete.

@Test(timeout = 5000)
public void testTerminatingVertexForVComplete() throws Exception {
    setupPreDagCreation();
    dagPlan = createSamplerDAGPlan(false);
    setupPostDagCreation();
    VertexImpl vertex = spy(vertices.get("A"));
    initVertex(vertex);
    startVertex(vertex);
    vertex.handle(new VertexEventTermination(vertex.getVertexId(), VertexTerminationCause.INTERNAL_ERROR));
    vertex.handle(new VertexEvent(vertex.getVertexId(), VertexEventType.V_COMPLETED));
    dispatcher.await();
    Assert.assertTrue(vertex.inTerminalState());
    for (String diagnostic : vertex.getDiagnostics()) {
        if (diagnostic.contains("Invalid event")) {
            fail("Unexpected Invalid event transition!");
        }
    }
}
Also used : VertexEventTermination(org.apache.tez.dag.app.dag.event.VertexEventTermination) VertexEvent(org.apache.tez.dag.app.dag.event.VertexEvent) ByteString(com.google.protobuf.ByteString) VertexManagerPluginForTest(org.apache.tez.test.VertexManagerPluginForTest) Test(org.junit.Test) GraceShuffleVertexManagerForTest(org.apache.tez.test.GraceShuffleVertexManagerForTest) StateChangeNotifierForTest(org.apache.tez.dag.app.dag.TestStateChangeNotifier.StateChangeNotifierForTest) EdgeManagerForTest(org.apache.tez.test.EdgeManagerForTest)

Aggregations

VertexEventTermination (org.apache.tez.dag.app.dag.event.VertexEventTermination)6 StateChangeNotifierForTest (org.apache.tez.dag.app.dag.TestStateChangeNotifier.StateChangeNotifierForTest)5 EdgeManagerForTest (org.apache.tez.test.EdgeManagerForTest)5 GraceShuffleVertexManagerForTest (org.apache.tez.test.GraceShuffleVertexManagerForTest)5 VertexManagerPluginForTest (org.apache.tez.test.VertexManagerPluginForTest)5 Test (org.junit.Test)5 ByteString (com.google.protobuf.ByteString)2 VertexEvent (org.apache.tez.dag.app.dag.event.VertexEvent)2 VertexEventTaskCompleted (org.apache.tez.dag.app.dag.event.VertexEventTaskCompleted)2 HashMap (java.util.HashMap)1 Configuration (org.apache.hadoop.conf.Configuration)1 EventHandler (org.apache.hadoop.yarn.event.EventHandler)1 TezConfiguration (org.apache.tez.dag.api.TezConfiguration)1 PlanTaskConfiguration (org.apache.tez.dag.api.records.DAGProtos.PlanTaskConfiguration)1 VertexPlan (org.apache.tez.dag.api.records.DAGProtos.VertexPlan)1 HistoryEventHandler (org.apache.tez.dag.history.HistoryEventHandler)1 TezDAGID (org.apache.tez.dag.records.TezDAGID)1 TezVertexID (org.apache.tez.dag.records.TezVertexID)1