[ONOS-6472] Flow, table, group and meter stats collector stopped after starting
Change-Id: I74c638662b6980d1895291e55e8aa5c203f1e40b
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java
index 886fb97..17cf980 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/OpenFlowRuleProvider.java
@@ -240,16 +240,16 @@
// NewAdaptiveFlowStatsCollector Constructor
NewAdaptiveFlowStatsCollector fsc =
new NewAdaptiveFlowStatsCollector(driverService, sw, flowPollFrequency);
- fsc.start();
stopCollectorIfNeeded(afsCollectors.put(new Dpid(sw.getId()), fsc));
+ fsc.start();
} else {
FlowStatsCollector fsc = new FlowStatsCollector(timer, sw, flowPollFrequency);
- fsc.start();
stopCollectorIfNeeded(simpleCollectors.put(new Dpid(sw.getId()), fsc));
+ fsc.start();
}
TableStatisticsCollector tsc = new TableStatisticsCollector(timer, sw, flowPollFrequency);
- tsc.start();
stopCollectorIfNeeded(tableStatsCollectors.put(new Dpid(sw.getId()), tsc));
+ tsc.start();
}
private void stopCollectorIfNeeded(SwitchDataCollector collector) {
diff --git a/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/OpenFlowGroupProvider.java b/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/OpenFlowGroupProvider.java
index 46abc77..cabd8dc 100644
--- a/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/OpenFlowGroupProvider.java
+++ b/providers/openflow/group/src/main/java/org/onosproject/provider/of/group/impl/OpenFlowGroupProvider.java
@@ -375,8 +375,8 @@
}
if (isGroupSupported(sw)) {
GroupStatsCollector gsc = new GroupStatsCollector(sw, POLL_INTERVAL);
- gsc.start();
stopCollectorIfNeeded(collectors.put(dpid, gsc));
+ gsc.start();
}
//figure out race condition
diff --git a/providers/openflow/meter/src/main/java/org/onosproject/provider/of/meter/impl/OpenFlowMeterProvider.java b/providers/openflow/meter/src/main/java/org/onosproject/provider/of/meter/impl/OpenFlowMeterProvider.java
index 76e4b15..f111576 100644
--- a/providers/openflow/meter/src/main/java/org/onosproject/provider/of/meter/impl/OpenFlowMeterProvider.java
+++ b/providers/openflow/meter/src/main/java/org/onosproject/provider/of/meter/impl/OpenFlowMeterProvider.java
@@ -234,8 +234,8 @@
private void createStatsCollection(OpenFlowSwitch sw) {
if (sw != null && isMeterSupported(sw)) {
MeterStatsCollector msc = new MeterStatsCollector(sw, POLL_INTERVAL);
- msc.start();
stopCollectorIfNeeded(collectors.put(new Dpid(sw.getId()), msc));
+ msc.start();
}
}