+ if (this.flowCapableTrackerRegistration != null) {
+ this.flowCapableTrackerRegistration.close();
+ this.flowCapableTrackerRegistration = null;
+ }
+ timer.cancel();
+ } catch (Exception e) {
+ spLogger.warn("Failed to stop Statistics Provider completely", e);
+ } finally {
+ spLogger.info("Statistics Provider stopped.");
+ }
+ }
+
+ void startNodeHandlers(final Collection<NodeKey> addedNodes) {
+ for (NodeKey key : addedNodes) {
+ if (handlers.containsKey(key.getId())) {
+ spLogger.warn("Attempted to start already-existing handler for {}, very strange", key.getId());
+ continue;
+ }
+
+ final NodeStatisticsHandler h = new NodeStatisticsHandler(dps, key,
+ flowStatsService, flowTableStatsService, groupStatsService,
+ meterStatsService, portStatsService, queueStatsService,srScheduler);
+ final NodeStatisticsHandler old = handlers.putIfAbsent(key.getId(), h);
+ if (old == null) {
+ spLogger.debug("Started node handler for {}", key.getId());
+ h.start(timer);
+ } else {
+ spLogger.debug("Prevented race on handler for {}", key.getId());
+ }
+ }