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 b63517b..3c02c17 100644 (file)
@@ -537,11 +537,10 @@ IInventoryShimExternalListener, CommandProvider {
             values = this.v6StatsListToOFStatsList(values);
         }
 
             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) {
     }
 
     private void notifyPortUpdate(Long switchId, List<OFStatistics> values) {
index b8f6ab4..7f9a13e 100644 (file)
@@ -587,9 +587,7 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener
             flowOnNodeList = filterFlowListPerContainer(container, node, flowOnNodeList);
 
             // notify listeners
             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
                     .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
                     .getNodeTableStatsList();
 
             // notify listeners
-            if (!tableStatsList.isEmpty()) {
-                l.getValue().nodeTableStatisticsUpdated(node, tableStatsList);
-            }
+            l.getValue().nodeTableStatisticsUpdated(node, tableStatsList);
         }
     }
 }
         }
     }
 }