Stats Mgr to skip equality check on flow stats 21/5121/2
authorAlessandro Boch <aboch@cisco.com>
Tue, 4 Feb 2014 17:20:32 +0000 (09:20 -0800)
committerAlessandro Boch <aboch@cisco.com>
Tue, 4 Feb 2014 18:30:34 +0000 (10:30 -0800)
- 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>
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