managementVertex.setExecutionState(ev.getExecutionState());
vertexMap.put(ev, managementVertex);
for (int i = 0; i < ev.getNumberOfOutputGates(); i++) {
final ExecutionGate outputGate = ev.getOutputGate(i);
final ManagementGate managementGate = new ManagementGate(managementVertex, new ManagementGateID(), i,
false);
gateMap.put(outputGate, managementGate);
}
for (int i = 0; i < ev.getNumberOfInputGates(); i++) {
final ExecutionGate inputGate = ev.getInputGate(i);
final ManagementGate managementGate = new ManagementGate(managementVertex, new ManagementGateID(), i,
true);
gateMap.put(inputGate, managementGate);
}
}
iterator = new ExecutionGraphIterator(executionGraph, true);
// Setup connections
while (iterator.hasNext()) {
final ExecutionVertex source = iterator.next();
for (int i = 0; i < source.getNumberOfOutputGates(); i++) {
final ExecutionGate outputGate = source.getOutputGate(i);
final ManagementGate manangementOutputGate = gateMap.get(outputGate);
final ChannelType channelType = outputGate.getChannelType();
for (int j = 0; j < outputGate.getNumberOfEdges(); j++) {
final ExecutionEdge outputChannel = outputGate.getEdge(j);
final ManagementGate managementInputGate = gateMap.get(outputChannel.getInputGate());
final ManagementEdgeID sourceEdgeID = new ManagementEdgeID(outputChannel.getOutputChannelID());
final ManagementEdgeID targetEdgeID = new ManagementEdgeID(outputChannel.getInputChannelID());
new ManagementEdge(sourceEdgeID, targetEdgeID, manangementOutputGate, j, managementInputGate,
outputChannel.getInputGateIndex(), channelType);