Skip to content
Snippets Groups Projects
Commit ff657f92 authored by Vishnu Emmadi's avatar Vishnu Emmadi
Browse files

topology events update

o show openflow cluster count with/without tunnels
o show external port count for each external cluster
parent ac19cb28
No related branches found
No related tags found
No related merge requests found
...@@ -186,28 +186,46 @@ public class TopologyManager implements ...@@ -186,28 +186,46 @@ public class TopologyManager implements
* the BigTopologyEvent class * the BigTopologyEvent class
*/ */
protected class TopologyEventInfo { protected class TopologyEventInfo {
private final int numOpenflowClusters; private final int numOpenflowClustersWithTunnels;
private final int numExternalClusters; private final int numOpenflowClustersWithoutTunnels;
private final int numExternalPorts; private final Map<Long, List<NodePortTuple>> externalPortsMap;
private final int numTunnelPorts; private final int numTunnelPorts;
public TopologyEventInfo(int numOpenflowClusters, public TopologyEventInfo(int numOpenflowClustersWithTunnels,
int numExternalClusters, int numExternalPorts, int numOpenflowClustersWithoutTunnels,
int numTunnelPorts) { Map<Long, List<NodePortTuple>> externalPortsMap,
int numTunnelPorts) {
super(); super();
this.numOpenflowClusters = numOpenflowClusters; this.numOpenflowClustersWithTunnels = numOpenflowClustersWithTunnels;
this.numExternalClusters = numExternalClusters; this.numOpenflowClustersWithoutTunnels = numOpenflowClustersWithoutTunnels;
this.numExternalPorts = numExternalPorts; this.externalPortsMap = externalPortsMap;
this.numTunnelPorts = numTunnelPorts; this.numTunnelPorts = numTunnelPorts;
} }
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("# Openflow Clusters: "); builder.append("# Openflow Clusters:");
builder.append(numOpenflowClusters); builder.append(" { With Tunnels: ");
builder.append(numOpenflowClustersWithTunnels);
builder.append(" Without Tunnels: ");
builder.append(numOpenflowClustersWithoutTunnels);
builder.append(" }");
builder.append(", # External Clusters: "); builder.append(", # External Clusters: ");
int numExternalClusters = externalPortsMap.size();
builder.append(numExternalClusters); builder.append(numExternalClusters);
builder.append(", # External Ports: "); if (numExternalClusters > 0) {
builder.append(numExternalPorts); builder.append(" { ");
int count = 0;
for (Long extCluster : externalPortsMap.keySet()) {
builder.append("#" + extCluster + ":Ext Ports: ");
builder.append(externalPortsMap.get(extCluster).size());
if (++count < numExternalClusters) {
builder.append(", ");
} else {
builder.append(" ");
}
}
builder.append("}");
}
builder.append(", # Tunnel Ports: "); builder.append(", # Tunnel Ports: ");
builder.append(numTunnelPorts); builder.append(numTunnelPorts);
return builder.toString(); return builder.toString();
...@@ -1229,7 +1247,9 @@ public class TopologyManager implements ...@@ -1229,7 +1247,9 @@ public class TopologyManager implements
currentInstanceWithoutTunnels = nt; currentInstanceWithoutTunnels = nt;
TopologyEventInfo topologyInfo = TopologyEventInfo topologyInfo =
new TopologyEventInfo(nt.getClusters().size(), 0, 0, 0); new TopologyEventInfo(0, nt.getClusters().size(),
new HashMap<Long, List<NodePortTuple>>(),
0);
evTopology.updateEventWithFlush(new TopologyEvent(reason, evTopology.updateEventWithFlush(new TopologyEvent(reason,
topologyInfo)); topologyInfo));
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment