BUG 789: Stats Mgr to skip equality check on flow stats 63/6563/1
authorSurekha Bejgam <sbejgam@cisco.com>
Tue, 4 Feb 2014 17:20:32 +0000 (09:20 -0800)
committerSurekha Bejgam <sbejgam@cisco.com>
Mon, 28 Apr 2014 21:38:25 +0000 (14:38 -0700)
- Statistics Manager runs an equality check on the list of flow statistics
  received from the protocol plugin with its cached ones to decide whether
  to update or not, in order to avoid a cluster cache update.
  In presence of flows on the switch, the flow updated statistics are always
  different becasue of the milli and nano secs duration fields they contain

Change-Id: I8290457c1d0a43294e2449cb16c14d6c1e36481e
Signed-off-by: Alessandro Boch <aboch@cisco.com>
Signed-off-by: Surekha Bejgam <sbejgam@cisco.com>
opendaylight/statisticsmanager/implementation/src/main/java/org/opendaylight/controller/statisticsmanager/internal/StatisticsManager.java

index aa6e4ac383ee2be208ed8124c1c5248fa95f26dc..5cd47f2f20a48cbf75774055267d0f2f90f6b751 100644 (file)
@@ -467,11 +467,8 @@ public class StatisticsManager implements IStatisticsManager, IReadServiceListen
 
     @Override
     public void nodeFlowStatisticsUpdated(Node node, List<FlowOnNode> flowStatsList) {
-        List<FlowOnNode> currentStat = this.flowStatistics.get(node);
-        // Update cache only if changed to avoid unnecessary cache sync operations
-        if (! flowStatsList.equals(currentStat)){
-            this.flowStatistics.put(node, flowStatsList);
-        }
+        // No equality check because duration fields change constantly
+        this.flowStatistics.put(node, flowStatsList);
     }
 
     @Override