final ManagementStage parent = entry.getValue();
for (int i = 0; i < executionStage.getNumberOfStageMembers(); i++) {
final ExecutionGroupVertex groupVertex = executionStage.getStageMember(i);
final ManagementGroupVertex managementGroupVertex = new ManagementGroupVertex(parent, groupVertex
.getName());
groupMap.put(groupVertex, managementGroupVertex);
}
}
// Second, make sure all edges are created and connected properly
iterator = stageMap.entrySet().iterator();
while (iterator.hasNext()) {
final Map.Entry<ExecutionStage, ManagementStage> entry = iterator.next();
final ExecutionStage executionStage = entry.getKey();
for (int i = 0; i < executionStage.getNumberOfStageMembers(); i++) {
final ExecutionGroupVertex sourceVertex = executionStage.getStageMember(i);
final ManagementGroupVertex sourceGroupVertex = groupMap.get(sourceVertex);
for (int j = 0; j < sourceVertex.getNumberOfForwardLinks(); j++) {
final ExecutionGroupEdge edge = sourceVertex.getForwardEdge(j);
final ExecutionGroupVertex targetVertex = edge.getTargetVertex();
final ManagementGroupVertex targetGroupVertex = groupMap.get(targetVertex);
new ManagementGroupEdge(sourceGroupVertex, j, targetGroupVertex, edge.getIndexOfInputGate(), edge
.getChannelType());
}
}
}