* Added new method FlowDatabaseOperation.getFlowSourceDpid() that
can be used to get the Source Switch DPID
* Added a boolean flag to FlowEventHandler and FlowManager to enable/disable
the new Flow setup mechanism:
enableOnrc2014MeasurementsFlows
* Create locally the FlowEventHandler.dbHandler instead of
reusing the dbHandler from the FlowManager.
Reusing the dbHandler from the FlowManager might not be thread-safe (??)
* Renamed flag FlowEventHandler.accessDBFlag
to enableOnrc2014MeasurementsTopology
(for consistency with the Flow setup-related flag)
* Changed the logic when reading the complete topology from the database:
if there is a topology-related event, we unconditionally assume
the topology has been modified. Long-term this might be sub-optimal,
but gives us the bare-bones behavior we want to measure.
* Reverse the change to Topology.readFromDatabase() to exclude the
compareTopology() call (see above bullet).
* Fix a bug when cheching whether there is any event to process.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java b/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java
index dedb589..92da9ba 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java
@@ -381,17 +381,13 @@
* Read topology state from the database.
*
* @param dbHandler the Graph Database handler to use.
- * @return true if topology is updated. In other words,
- * topology read from database is different from current topology.
*/
- public boolean readFromDatabase(GraphDBOperation dbHandler) {
+ public void readFromDatabase(GraphDBOperation dbHandler) {
//
// Fetch the relevant info from the Switch and Port vertices
// from the Titan Graph.
//
-
- Map<Long,Node> oldNodesMap = nodesMap;
- nodesMap = new TreeMap<Long,Node>();
+ nodesMap = new TreeMap<Long,Node>();
Iterable<ISwitchObject> activeSwitches = dbHandler.getActiveSwitches();
for (ISwitchObject switchObj : activeSwitches) {
@@ -456,7 +452,6 @@
}
}
dbHandler.commit();
- return ! compareTopology(oldNodesMap, nodesMap);
}
// TODO Merge into loops in readFromDatabase() can reduce execution time.