X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Finternal%2FOFStatisticsManager.java;h=3ab38cc41f6db686b273864801c238f3cb36eb11;hb=dfa4383b0b5c9c6de340526a62aef731922fa29f;hp=e3a1ffec96cc28d26b0dcc247763aeef1c06184d;hpb=850d5b748e96c2667bb95ce423bdb00083838619;p=controller.git 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 e3a1ffec96..3ab38cc41f 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 @@ -98,7 +98,7 @@ IInventoryShimExternalListener, CommandProvider { private ConcurrentMap switchSupportsVendorExtStats; // Per port sampled (every portStatsPeriod) transmit rate private Map> txRates; - private Set statisticsListeners; + private Set statisticsListeners = new CopyOnWriteArraySet(); /** * The object containing the latest factoredSamples tx rate samples for a @@ -198,12 +198,11 @@ IInventoryShimExternalListener, CommandProvider { switchPortStatsUpdated = new LinkedBlockingQueue(INITIAL_SIZE); switchSupportsVendorExtStats = new ConcurrentHashMap(INITIAL_SIZE); txRates = new HashMap>(INITIAL_SIZE); - statisticsListeners = new CopyOnWriteArraySet(); configStatsPollIntervals(); // Initialize managed timers - statisticsTimer = new Timer(); + statisticsTimer = new Timer("Statistics Timer Ticks"); statisticsTimerTask = new TimerTask() { @Override public void run() { @@ -222,6 +221,7 @@ IInventoryShimExternalListener, CommandProvider { } catch (InterruptedException e) { log.warn("Flow Statistics Collector thread " + "interrupted", e); + return; } } } @@ -237,6 +237,7 @@ IInventoryShimExternalListener, CommandProvider { updatePortsTxRate(switchId); } catch (InterruptedException e) { log.warn("TX Rate Updater thread interrupted", e); + return; } } } @@ -250,6 +251,7 @@ IInventoryShimExternalListener, CommandProvider { * */ void destroy() { + statisticsListeners.clear(); } /**