From 1f46115777f3dfe4ed653ea2c06cd3fe637fb122 Mon Sep 17 00:00:00 2001 From: Yevgeny Khodorkovsky Date: Thu, 11 Jul 2013 18:19:51 -0700 Subject: [PATCH 1/1] Bug fix: flow statistics are not notified if empty Change-Id: Id685f6205bd75e666972e30a86584a0b4a1498ec Signed-off-by: Yevgeny Khodorkovsky --- .../openflow/internal/OFStatisticsManager.java | 7 +++---- .../openflow/internal/ReadServiceFilter.java | 13 ++++--------- 2 files changed, 7 insertions(+), 13 deletions(-) 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); } } } -- 2.36.6