Search in sources :

Example 11 with EventRouteMetadata

use of org.apache.tez.dag.api.EdgeManagerPluginOnDemand.EventRouteMetadata in project tez by apache.

the class TestCartesianProductEdgeManagerPartitioned method testThreeWayV0.

private void testThreeWayV0(CartesianProductConfigProto config) throws Exception {
    when(mockContext.getSourceVertexName()).thenReturn("v0");
    when(mockContext.getSourceVertexNumTasks()).thenReturn(2);
    edgeManager.initialize(config);
    CompositeEventRouteMetadata compositeRoutingData = edgeManager.routeCompositeDataMovementEventToDestination(1, 1);
    assertNotNull(compositeRoutingData);
    assertEquals(1, compositeRoutingData.getCount());
    assertEquals(0, compositeRoutingData.getSource());
    assertEquals(1, compositeRoutingData.getTarget());
    EventRouteMetadata routingData = edgeManager.routeInputSourceTaskFailedEventToDestination(1, 1);
    assertNotNull(routingData);
    assertEquals(1, routingData.getNumEvents());
    assertArrayEquals(new int[] { 1 }, routingData.getTargetIndices());
    assertEquals(1, edgeManager.routeInputErrorEventToSource(1, 1));
    assertEquals(24, edgeManager.getNumDestinationConsumerTasks(1));
    assertEquals(2, edgeManager.getNumDestinationTaskPhysicalInputs(10));
    assertEquals(4, edgeManager.getNumSourceTaskPhysicalOutputs(2));
}
Also used : CompositeEventRouteMetadata(org.apache.tez.dag.api.EdgeManagerPluginOnDemand.CompositeEventRouteMetadata) EventRouteMetadata(org.apache.tez.dag.api.EdgeManagerPluginOnDemand.EventRouteMetadata) CompositeEventRouteMetadata(org.apache.tez.dag.api.EdgeManagerPluginOnDemand.CompositeEventRouteMetadata)

Example 12 with EventRouteMetadata

use of org.apache.tez.dag.api.EdgeManagerPluginOnDemand.EventRouteMetadata in project tez by apache.

the class TestCartesianProductEdgeManagerPartitioned method testTwoWayV0.

private void testTwoWayV0(CartesianProductConfigProto config) throws Exception {
    when(mockContext.getSourceVertexName()).thenReturn("v0");
    when(mockContext.getSourceVertexNumTasks()).thenReturn(2);
    edgeManager.initialize(config);
    CompositeEventRouteMetadata compositeRoutingData = edgeManager.routeCompositeDataMovementEventToDestination(1, 1);
    assertNotNull(compositeRoutingData);
    assertEquals(1, compositeRoutingData.getCount());
    assertEquals(0, compositeRoutingData.getSource());
    assertEquals(1, compositeRoutingData.getTarget());
    EventRouteMetadata routingData = edgeManager.routeDataMovementEventToDestination(1, 0, 1);
    assertNotNull(routingData);
    assertEquals(1, routingData.getNumEvents());
    assertArrayEquals(new int[] { 1 }, routingData.getTargetIndices());
    routingData = edgeManager.routeDataMovementEventToDestination(1, 1, 1);
    assertNull(routingData);
    routingData = edgeManager.routeInputSourceTaskFailedEventToDestination(1, 1);
    assertNotNull(routingData);
    assertEquals(1, routingData.getNumEvents());
    assertArrayEquals(new int[] { 1 }, routingData.getTargetIndices());
    assertEquals(1, edgeManager.routeInputErrorEventToSource(1, 1));
    assertEquals(12, edgeManager.getNumDestinationConsumerTasks(1));
    assertEquals(2, edgeManager.getNumDestinationTaskPhysicalInputs(10));
    assertEquals(3, edgeManager.getNumSourceTaskPhysicalOutputs(2));
}
Also used : CompositeEventRouteMetadata(org.apache.tez.dag.api.EdgeManagerPluginOnDemand.CompositeEventRouteMetadata) EventRouteMetadata(org.apache.tez.dag.api.EdgeManagerPluginOnDemand.EventRouteMetadata) CompositeEventRouteMetadata(org.apache.tez.dag.api.EdgeManagerPluginOnDemand.CompositeEventRouteMetadata)

Aggregations

EventRouteMetadata (org.apache.tez.dag.api.EdgeManagerPluginOnDemand.EventRouteMetadata)12 CompositeEventRouteMetadata (org.apache.tez.dag.api.EdgeManagerPluginOnDemand.CompositeEventRouteMetadata)9 EdgeManagerPluginOnDemand (org.apache.tez.dag.api.EdgeManagerPluginOnDemand)4 TezEvent (org.apache.tez.runtime.api.impl.TezEvent)4 LinkedList (java.util.LinkedList)3 TaskLocationHint (org.apache.tez.dag.api.TaskLocationHint)3 VertexLocationHint (org.apache.tez.dag.api.VertexLocationHint)3 VertexManagerPluginContext (org.apache.tez.dag.api.VertexManagerPluginContext)3 ScheduleTaskRequest (org.apache.tez.dag.api.VertexManagerPluginContext.ScheduleTaskRequest)3 PlanTaskLocationHint (org.apache.tez.dag.api.records.DAGProtos.PlanTaskLocationHint)3 TaskAttemptEventInfo (org.apache.tez.dag.app.TaskAttemptEventInfo)3 StateChangeNotifierForTest (org.apache.tez.dag.app.dag.TestStateChangeNotifier.StateChangeNotifierForTest)3 VertexEventRouteEvent (org.apache.tez.dag.app.dag.event.VertexEventRouteEvent)3 TezTaskAttemptID (org.apache.tez.dag.records.TezTaskAttemptID)3 EventMetaData (org.apache.tez.runtime.api.impl.EventMetaData)3 EdgeManagerForTest (org.apache.tez.test.EdgeManagerForTest)3 GraceShuffleVertexManagerForTest (org.apache.tez.test.GraceShuffleVertexManagerForTest)3 VertexManagerPluginForTest (org.apache.tez.test.VertexManagerPluginForTest)3 Test (org.junit.Test)3 TezException (org.apache.tez.dag.api.TezException)1