From: Yevgeny Khodorkovsky Date: Fri, 12 Jul 2013 01:19:51 +0000 (-0700) Subject: Bug fix: flow statistics are not notified if empty X-Git-Tag: releasepom-0.1.0~286 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=1f46115777f3dfe4ed653ea2c06cd3fe637fb122;hp=0df356fd6dd1e24f82a4afaa6c824517d354fb20;ds=sidebyside Bug fix: flow statistics are not notified if empty Change-Id: Id685f6205bd75e666972e30a86584a0b4a1498ec Signed-off-by: Yevgeny Khodorkovsky --- diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java index b63517b8ad..3c02c17628 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java @@ -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 values) { diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java index b8f6ab4715..7f9a13e92a 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java @@ -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); } } }