Bug fix: flow statistics are not notified if empty 94/594/1
authorYevgeny Khodorkovsky <ykhodork@cisco.com>
Fri, 12 Jul 2013 01:19:51 +0000 (18:19 -0700)
committerYevgeny Khodorkovsky <ykhodork@cisco.com>
Fri, 12 Jul 2013 01:21:23 +0000 (18:21 -0700)
Change-Id: Id685f6205bd75e666972e30a86584a0b4a1498ec
Signed-off-by: Yevgeny Khodorkovsky <ykhodork@cisco.com>
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java

index b63517b8add5d90a4df4aecd386c63767fd47e50..3c02c1762875eceb1ba226f8b333584af9b852bf 100644 (file)
@@ -537,11 +537,10 @@ IInventoryShimExternalListener, CommandProvider {
             values = this.v6StatsListToOFStatsList(values);
         }
 
-        if (!values.isEmpty()) { //possiblly filtered out by v6StatsListToOFStatsList()
-            for (IOFStatisticsListener l : this.statisticsListeners) {
-                l.flowStatisticsRefreshed(switchId, values);
-            }
+        for (IOFStatisticsListener l : this.statisticsListeners) {
+            l.flowStatisticsRefreshed(switchId, values);
         }
+
     }
 
     private void notifyPortUpdate(Long switchId, List<OFStatistics> values) {
index b8f6ab471525d9f0bb633912fc52982ca8b3cf3e..7f9a13e92ac3be846342a7615e37ec658d8b9fa0 100644 (file)
@@ -587,9 +587,7 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener
             flowOnNodeList = filterFlowListPerContainer(container, node, flowOnNodeList);
 
             // notify listeners
-            if (!flowOnNodeList.isEmpty()) {
-                l.getValue().nodeFlowStatisticsUpdated(node, flowOnNodeList);
-            }
+            l.getValue().nodeFlowStatisticsUpdated(node, flowOnNodeList);
         }
     }
 
@@ -606,9 +604,8 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener
                     .getNodeConnectorStatsList();
 
             // notify listeners
-            if (!ncStatsList.isEmpty()) {
-                l.getValue().nodeConnectorStatisticsUpdated(node, ncStatsList);
-            }
+            l.getValue().nodeConnectorStatisticsUpdated(node, ncStatsList);
+
         }
     }
 
@@ -625,9 +622,7 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener
                     .getNodeTableStatsList();
 
             // notify listeners
-            if (!tableStatsList.isEmpty()) {
-                l.getValue().nodeTableStatisticsUpdated(node, tableStatsList);
-            }
+            l.getValue().nodeTableStatisticsUpdated(node, tableStatsList);
         }
     }
 }