* Enable by default the new Flow mechanism.
* Fix a bug: inside method FlowEventHandler.prepareMyFlows():
Automatically add all Flow ID events (for the Flows this instance
is responsible for) to the collection of Flows to recompute.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
index 9d37a63..1f2cdf1 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
@@ -46,8 +46,8 @@
*/
class FlowEventHandler extends Thread implements IFlowEventHandlerService {
- private boolean enableOnrc2014MeasurementsFlows = false;
- private boolean enableOnrc2014MeasurementsTopology = false;
+ private boolean enableOnrc2014MeasurementsFlows = true;
+ private boolean enableOnrc2014MeasurementsTopology = true;
/** The logger. */
private final static Logger log = LoggerFactory.getLogger(FlowEventHandler.class);
@@ -431,10 +431,24 @@
* @param mySwitches the collection of my switches.
*/
private void prepareMyFlows(Map<Long, IOFSwitch> mySwitches) {
+ // Fetch my flows from the database
ArrayList<FlowPath> myFlows = flowManager.getAllMyFlows(mySwitches);
for (FlowPath flowPath : myFlows) {
allFlowPaths.put(flowPath.flowId().value(), flowPath);
}
+
+ //
+ // Automatically add all Flow ID events (for the Flows this instance
+ // is responsible for) to the collection of Flows to recompute.
+ //
+ for (EventEntry<FlowId> eventEntry : flowIdEvents) {
+ FlowId flowId = eventEntry.eventData();
+ FlowPath flowPath = allFlowPaths.get(flowId.value());
+ if (flowPath != null) {
+ shouldRecomputeFlowPaths.put(flowPath.flowId().value(),
+ flowPath);
+ }
+ }
}
/**
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index 121c72a..919eeb9 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -49,7 +49,7 @@
*/
public class FlowManager implements IFloodlightModule, IFlowService, INetMapStorage {
- private boolean enableOnrc2014MeasurementsFlows = false;
+ private boolean enableOnrc2014MeasurementsFlows = true;
protected GraphDBOperation dbHandlerApi;
protected GraphDBOperation dbHandlerInner;