logEvents(event, deserializedEvent);
}
private void testVertexParallelismUpdatedEvent() throws Exception {
{
InputSpecUpdate rootInputSpecUpdateBulk = InputSpecUpdate
.createAllTaskInputSpecUpdate(2);
InputSpecUpdate rootInputSpecUpdatePerTask = InputSpecUpdate
.createPerTaskInputSpecUpdate(Lists.newArrayList(1, 2, 3));
Map<String, InputSpecUpdate> rootInputSpecUpdates = new HashMap<String, InputSpecUpdate>();
rootInputSpecUpdates.put("input1", rootInputSpecUpdateBulk);
rootInputSpecUpdates.put("input2", rootInputSpecUpdatePerTask);
VertexParallelismUpdatedEvent event =
new VertexParallelismUpdatedEvent(
TezVertexID.getInstance(
TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111),
100, null, null, rootInputSpecUpdates);
VertexParallelismUpdatedEvent deserializedEvent = (VertexParallelismUpdatedEvent)
testProtoConversion(event);
Assert.assertEquals(event.getVertexID(), deserializedEvent.getVertexID());
Assert.assertEquals(event.getNumTasks(), deserializedEvent.getNumTasks());
Assert.assertEquals(event.getSourceEdgeManagers(),
deserializedEvent.getSourceEdgeManagers());
Assert.assertEquals(event.getVertexLocationHint(),
deserializedEvent.getVertexLocationHint());
Assert.assertEquals(event.getRootInputSpecUpdates().size(), deserializedEvent
.getRootInputSpecUpdates().size());
InputSpecUpdate deserializedBulk = deserializedEvent.getRootInputSpecUpdates().get("input1");
InputSpecUpdate deserializedPerTask = deserializedEvent.getRootInputSpecUpdates().get("input2");
Assert.assertEquals(rootInputSpecUpdateBulk.isForAllWorkUnits(),
deserializedBulk.isForAllWorkUnits());
Assert.assertEquals(rootInputSpecUpdateBulk.getAllNumPhysicalInputs(),
deserializedBulk.getAllNumPhysicalInputs());
Assert.assertEquals(rootInputSpecUpdatePerTask.isForAllWorkUnits(),
deserializedPerTask.isForAllWorkUnits());
Assert.assertEquals(rootInputSpecUpdatePerTask.getAllNumPhysicalInputs(),
deserializedPerTask.getAllNumPhysicalInputs());
logEvents(event, deserializedEvent);
}
{
Map<String,EdgeManagerPluginDescriptor> sourceEdgeManagers
= new LinkedHashMap<String, EdgeManagerPluginDescriptor>();