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));
}
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));
}
Aggregations