2 * Copyright IBM Corporation, 2013. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.md.statistics.manager;
10 import java.util.Collection;
11 import java.util.Timer;
12 import java.util.TimerTask;
13 import java.util.concurrent.ConcurrentHashMap;
14 import java.util.concurrent.ConcurrentMap;
15 import java.util.concurrent.ExecutionException;
16 import java.util.concurrent.Future;
17 import java.util.concurrent.TimeUnit;
19 import org.opendaylight.controller.md.statistics.manager.MultipartMessageManager.StatsRequestType;
20 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
21 import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
22 import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
23 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
24 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
25 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
32 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder;
33 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput;
34 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesInputBuilder;
35 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesOutput;
36 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableInputBuilder;
37 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableOutput;
38 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
39 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.GetFlowTablesStatisticsInputBuilder;
40 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.GetFlowTablesStatisticsOutput;
41 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsService;
42 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
43 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId;
44 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsInputBuilder;
45 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsOutput;
46 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionInputBuilder;
47 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionOutput;
48 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService;
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
51 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
52 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
53 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
54 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
56 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
57 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsInputBuilder;
58 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsOutput;
59 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterStatisticsInputBuilder;
60 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterStatisticsOutput;
61 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsService;
62 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetAllNodeConnectorsStatisticsInputBuilder;
63 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetAllNodeConnectorsStatisticsOutput;
64 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
65 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromAllPortsInputBuilder;
66 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromAllPortsOutput;
67 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetQueueStatisticsFromGivenPortInputBuilder;
68 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetQueueStatisticsFromGivenPortOutput;
69 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsService;
70 import org.opendaylight.yangtools.concepts.ListenerRegistration;
71 import org.opendaylight.yangtools.concepts.Registration;
72 import org.opendaylight.yangtools.yang.binding.DataObject;
73 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
74 import org.opendaylight.yangtools.yang.binding.NotificationListener;
75 import org.opendaylight.yangtools.yang.common.RpcResult;
76 import org.slf4j.Logger;
77 import org.slf4j.LoggerFactory;
79 import com.google.common.base.Preconditions;
82 * Following are main responsibilities of the class:
83 * 1) Invoke statistics request thread to send periodic statistics request to all the
84 * flow capable switch connected to the controller. It sends statistics request for
85 * Group,Meter,Table,Flow,Queue,Aggregate stats.
87 * 2) Invoke statistics ager thread, to clean up all the stale statistics data from
88 * operational data store.
90 * @author avishnoi@in.ibm.com
93 public class StatisticsProvider implements AutoCloseable {
94 public static final long STATS_COLLECTION_MILLIS = TimeUnit.SECONDS.toMillis(15);
96 private static final Logger spLogger = LoggerFactory.getLogger(StatisticsProvider.class);
98 private final ConcurrentMap<NodeId, NodeStatisticsHandler> handlers = new ConcurrentHashMap<>();
99 private final MultipartMessageManager multipartMessageManager = new MultipartMessageManager();
100 private final Timer timer = new Timer("statistics-manager", true);
101 private final DataProviderService dps;
103 private OpendaylightGroupStatisticsService groupStatsService;
105 private OpendaylightMeterStatisticsService meterStatsService;
107 private OpendaylightFlowStatisticsService flowStatsService;
109 private OpendaylightPortStatisticsService portStatsService;
111 private OpendaylightFlowTableStatisticsService flowTableStatsService;
113 private OpendaylightQueueStatisticsService queueStatsService;
115 private StatisticsUpdateHandler statsUpdateHandler;
117 public StatisticsProvider(final DataProviderService dataService) {
118 this.dps = Preconditions.checkNotNull(dataService);
121 public MultipartMessageManager getMultipartMessageManager() {
122 return multipartMessageManager;
125 private final StatisticsListener updateCommiter = new StatisticsListener(StatisticsProvider.this);
127 private Registration<NotificationListener> listenerRegistration;
129 private ListenerRegistration<DataChangeListener> flowCapableTrackerRegistration;
131 public void start(final DataBrokerService dbs, final NotificationProviderService nps, final RpcConsumerRegistry rpcRegistry) {
133 // Get Group/Meter statistics service instances
134 groupStatsService = rpcRegistry.getRpcService(OpendaylightGroupStatisticsService.class);
135 meterStatsService = rpcRegistry.getRpcService(OpendaylightMeterStatisticsService.class);
136 flowStatsService = rpcRegistry.getRpcService(OpendaylightFlowStatisticsService.class);
137 portStatsService = rpcRegistry.getRpcService(OpendaylightPortStatisticsService.class);
138 flowTableStatsService = rpcRegistry.getRpcService(OpendaylightFlowTableStatisticsService.class);
139 queueStatsService = rpcRegistry.getRpcService(OpendaylightQueueStatisticsService.class);
141 // Start receiving notifications
142 this.listenerRegistration = nps.registerNotificationListener(this.updateCommiter);
144 // Register for switch connect/disconnect notifications
145 final InstanceIdentifier<FlowCapableNode> fcnId = InstanceIdentifier.builder(Nodes.class)
146 .child(Node.class).augmentation(FlowCapableNode.class).build();
147 spLogger.debug("Registering FlowCapable tracker to {}", fcnId);
148 this.flowCapableTrackerRegistration = dbs.registerDataChangeListener(fcnId,
149 new FlowCapableTracker(this, fcnId));
151 statsUpdateHandler = new StatisticsUpdateHandler(StatisticsProvider.this);
152 registerDataStoreUpdateListener(dbs);
154 timer.schedule(new TimerTask() {
158 // Send stats requests
159 statsRequestSender();
162 for(NodeStatisticsHandler nodeStatisticsAger : handlers.values()){
163 nodeStatisticsAger.cleanStaleStatistics();
166 multipartMessageManager.cleanStaleTransactionIds();
167 } catch (RuntimeException e) {
168 spLogger.warn("Failed to request statistics", e);
171 }, 0, STATS_COLLECTION_MILLIS);
173 spLogger.debug("Statistics timer task with timer interval : {}ms", STATS_COLLECTION_MILLIS);
174 spLogger.info("Statistics Provider started.");
177 private void registerDataStoreUpdateListener(DataBrokerService dbs) {
178 // FIXME: the below should be broken out into StatisticsUpdateHandler
180 //Register for flow updates
181 InstanceIdentifier<? extends DataObject> pathFlow = InstanceIdentifier.builder(Nodes.class).child(Node.class)
182 .augmentation(FlowCapableNode.class)
184 .child(Flow.class).toInstance();
185 dbs.registerDataChangeListener(pathFlow, statsUpdateHandler);
187 //Register for meter updates
188 InstanceIdentifier<? extends DataObject> pathMeter = InstanceIdentifier.builder(Nodes.class).child(Node.class)
189 .augmentation(FlowCapableNode.class)
190 .child(Meter.class).toInstance();
192 dbs.registerDataChangeListener(pathMeter, statsUpdateHandler);
194 //Register for group updates
195 InstanceIdentifier<? extends DataObject> pathGroup = InstanceIdentifier.builder(Nodes.class).child(Node.class)
196 .augmentation(FlowCapableNode.class)
197 .child(Group.class).toInstance();
198 dbs.registerDataChangeListener(pathGroup, statsUpdateHandler);
200 //Register for queue updates
201 InstanceIdentifier<? extends DataObject> pathQueue = InstanceIdentifier.builder(Nodes.class).child(Node.class)
202 .child(NodeConnector.class)
203 .augmentation(FlowCapableNodeConnector.class)
204 .child(Queue.class).toInstance();
205 dbs.registerDataChangeListener(pathQueue, statsUpdateHandler);
208 protected DataModificationTransaction startChange() {
209 return dps.beginTransaction();
212 private void statsRequestSender() {
213 for (NodeStatisticsHandler h : handlers.values()) {
214 sendStatisticsRequestsToNode(h);
218 private void sendStatisticsRequestsToNode(final NodeStatisticsHandler h) {
219 NodeKey targetNode = h.getTargetNodeKey();
220 spLogger.debug("Send requests for statistics collection to node : {}", targetNode.getId());
223 if(flowTableStatsService != null){
224 sendAllFlowTablesStatisticsRequest(h);
226 if(flowStatsService != null){
227 // FIXME: it does not make sense to trigger this before sendAllFlowTablesStatisticsRequest()
228 // comes back -- we do not have any tables anyway.
229 sendAggregateFlowsStatsFromAllTablesRequest(h);
231 sendAllFlowsStatsFromAllTablesRequest(h);
233 if(portStatsService != null){
234 sendAllNodeConnectorsStatisticsRequest(h);
236 if(groupStatsService != null){
237 sendAllGroupStatisticsRequest(h);
238 sendGroupDescriptionRequest(h.getTargetNodeRef());
240 if(meterStatsService != null){
241 sendAllMeterStatisticsRequest(h);
242 sendMeterConfigStatisticsRequest(h.getTargetNodeRef());
244 if(queueStatsService != null){
245 sendAllQueueStatsFromAllNodeConnector(h);
248 spLogger.error("Exception occured while sending statistics requests : {}", e);
253 private void sendAllFlowTablesStatisticsRequest(NodeStatisticsHandler h) throws InterruptedException, ExecutionException {
254 final GetFlowTablesStatisticsInputBuilder input =
255 new GetFlowTablesStatisticsInputBuilder();
257 input.setNode(h.getTargetNodeRef());
259 Future<RpcResult<GetFlowTablesStatisticsOutput>> response =
260 flowTableStatsService.getFlowTablesStatistics(input.build());
262 this.multipartMessageManager.addTxIdToRequestTypeEntry(h.getTargetNodeKey().getId(),response.get().getResult().getTransactionId()
263 , StatsRequestType.ALL_FLOW_TABLE);
267 private void sendAllFlowsStatsFromAllTablesRequest(NodeStatisticsHandler h) throws InterruptedException, ExecutionException{
268 final GetAllFlowsStatisticsFromAllFlowTablesInputBuilder input =
269 new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder();
271 input.setNode(h.getTargetNodeRef());
273 Future<RpcResult<GetAllFlowsStatisticsFromAllFlowTablesOutput>> response =
274 flowStatsService.getAllFlowsStatisticsFromAllFlowTables(input.build());
276 this.multipartMessageManager.addTxIdToRequestTypeEntry(h.getTargetNodeKey().getId(), response.get().getResult().getTransactionId()
277 , StatsRequestType.ALL_FLOW);
281 public void sendFlowStatsFromTableRequest(NodeRef targetNode,Flow flow) throws InterruptedException, ExecutionException{
282 final GetFlowStatisticsFromFlowTableInputBuilder input =
283 new GetFlowStatisticsFromFlowTableInputBuilder();
285 input.setNode(targetNode);
286 input.fieldsFrom(flow);
288 Future<RpcResult<GetFlowStatisticsFromFlowTableOutput>> response =
289 flowStatsService.getFlowStatisticsFromFlowTable(input.build());
291 this.multipartMessageManager.addTxIdToRequestTypeEntry(getNodeId(targetNode), response.get().getResult().getTransactionId()
292 , StatsRequestType.ALL_FLOW);
296 private void sendAggregateFlowsStatsFromAllTablesRequest(final NodeStatisticsHandler h) throws InterruptedException, ExecutionException{
297 final Collection<TableKey> tables = h.getKnownTables();
298 spLogger.debug("Node {} supports {} table(s)", h, tables.size());
300 for (TableKey key : h.getKnownTables()) {
301 sendAggregateFlowsStatsFromTableRequest(h.getTargetNodeKey(), key.getId().shortValue());
305 private void sendAggregateFlowsStatsFromTableRequest(NodeKey targetNodeKey,Short tableId) throws InterruptedException, ExecutionException{
307 spLogger.debug("Send aggregate stats request for flow table {} to node {}",tableId,targetNodeKey);
308 GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder input =
309 new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder();
311 input.setNode(new NodeRef(InstanceIdentifier.builder(Nodes.class).child(Node.class, targetNodeKey).toInstance()));
312 input.setTableId(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId(tableId));
313 Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>> response =
314 flowStatsService.getAggregateFlowStatisticsFromFlowTableForAllFlows(input.build());
316 multipartMessageManager.setTxIdAndTableIdMapEntry(targetNodeKey.getId(), response.get().getResult().getTransactionId(), tableId);
317 this.multipartMessageManager.addTxIdToRequestTypeEntry(targetNodeKey.getId(), response.get().getResult().getTransactionId()
318 , StatsRequestType.AGGR_FLOW);
321 private void sendAllNodeConnectorsStatisticsRequest(NodeStatisticsHandler h) throws InterruptedException, ExecutionException{
323 final GetAllNodeConnectorsStatisticsInputBuilder input = new GetAllNodeConnectorsStatisticsInputBuilder();
325 input.setNode(h.getTargetNodeRef());
327 Future<RpcResult<GetAllNodeConnectorsStatisticsOutput>> response =
328 portStatsService.getAllNodeConnectorsStatistics(input.build());
329 this.multipartMessageManager.addTxIdToRequestTypeEntry(h.getTargetNodeKey().getId(), response.get().getResult().getTransactionId()
330 , StatsRequestType.ALL_PORT);
334 private void sendAllGroupStatisticsRequest(NodeStatisticsHandler h) throws InterruptedException, ExecutionException{
336 final GetAllGroupStatisticsInputBuilder input = new GetAllGroupStatisticsInputBuilder();
338 input.setNode(h.getTargetNodeRef());
340 Future<RpcResult<GetAllGroupStatisticsOutput>> response =
341 groupStatsService.getAllGroupStatistics(input.build());
343 this.multipartMessageManager.addTxIdToRequestTypeEntry(h.getTargetNodeKey().getId(), response.get().getResult().getTransactionId()
344 , StatsRequestType.ALL_GROUP);
348 public void sendGroupDescriptionRequest(NodeRef targetNode) throws InterruptedException, ExecutionException{
349 final GetGroupDescriptionInputBuilder input = new GetGroupDescriptionInputBuilder();
351 input.setNode(targetNode);
353 Future<RpcResult<GetGroupDescriptionOutput>> response =
354 groupStatsService.getGroupDescription(input.build());
356 this.multipartMessageManager.addTxIdToRequestTypeEntry(getNodeId(targetNode), response.get().getResult().getTransactionId()
357 , StatsRequestType.GROUP_DESC);
361 private void sendAllMeterStatisticsRequest(NodeStatisticsHandler h) throws InterruptedException, ExecutionException{
363 GetAllMeterStatisticsInputBuilder input = new GetAllMeterStatisticsInputBuilder();
365 input.setNode(h.getTargetNodeRef());
367 Future<RpcResult<GetAllMeterStatisticsOutput>> response =
368 meterStatsService.getAllMeterStatistics(input.build());
370 this.multipartMessageManager.addTxIdToRequestTypeEntry(h.getTargetNodeKey().getId(), response.get().getResult().getTransactionId()
371 , StatsRequestType.ALL_METER);;
375 public void sendMeterConfigStatisticsRequest(NodeRef targetNode) throws InterruptedException, ExecutionException{
377 GetAllMeterConfigStatisticsInputBuilder input = new GetAllMeterConfigStatisticsInputBuilder();
379 input.setNode(targetNode);
381 Future<RpcResult<GetAllMeterConfigStatisticsOutput>> response =
382 meterStatsService.getAllMeterConfigStatistics(input.build());
384 this.multipartMessageManager.addTxIdToRequestTypeEntry(getNodeId(targetNode), response.get().getResult().getTransactionId()
385 , StatsRequestType.METER_CONFIG);;
389 private void sendAllQueueStatsFromAllNodeConnector(NodeStatisticsHandler h) throws InterruptedException, ExecutionException {
390 GetAllQueuesStatisticsFromAllPortsInputBuilder input = new GetAllQueuesStatisticsFromAllPortsInputBuilder();
392 input.setNode(h.getTargetNodeRef());
394 Future<RpcResult<GetAllQueuesStatisticsFromAllPortsOutput>> response =
395 queueStatsService.getAllQueuesStatisticsFromAllPorts(input.build());
397 this.multipartMessageManager.addTxIdToRequestTypeEntry(h.getTargetNodeKey().getId(), response.get().getResult().getTransactionId()
398 , StatsRequestType.ALL_QUEUE_STATS);;
402 public void sendQueueStatsFromGivenNodeConnector(NodeRef targetNode,NodeConnectorId nodeConnectorId, QueueId queueId) throws InterruptedException, ExecutionException {
403 GetQueueStatisticsFromGivenPortInputBuilder input = new GetQueueStatisticsFromGivenPortInputBuilder();
405 input.setNode(targetNode);
406 input.setNodeConnectorId(nodeConnectorId);
407 input.setQueueId(queueId);
408 Future<RpcResult<GetQueueStatisticsFromGivenPortOutput>> response =
409 queueStatsService.getQueueStatisticsFromGivenPort(input.build());
411 this.multipartMessageManager.addTxIdToRequestTypeEntry(getNodeId(targetNode), response.get().getResult().getTransactionId()
412 , StatsRequestType.ALL_QUEUE_STATS);;
417 * Get the handler for a particular node.
419 * @param nodeId source node
420 * @return Node statistics handler for that node. Null if the statistics should
423 public final NodeStatisticsHandler getStatisticsHandler(final NodeId nodeId) {
424 Preconditions.checkNotNull(nodeId);
425 NodeStatisticsHandler handler = handlers.get(nodeId);
426 if (handler == null) {
427 spLogger.info("Attempted to get non-existing handler for {}", nodeId);
432 @SuppressWarnings("unchecked")
433 private NodeId getNodeId(NodeRef nodeRef){
434 InstanceIdentifier<Node> nodeII = (InstanceIdentifier<Node>) nodeRef.getValue();
435 NodeKey nodeKey = InstanceIdentifier.keyOf(nodeII);
436 return nodeKey.getId();
440 public void close() {
442 if (this.listenerRegistration != null) {
443 this.listenerRegistration.close();
444 this.listenerRegistration = null;
446 if (this.flowCapableTrackerRegistration != null) {
447 this.flowCapableTrackerRegistration.close();
448 this.flowCapableTrackerRegistration = null;
451 } catch (Exception e) {
452 spLogger.warn("Failed to stop Statistics Provider completely", e);
454 spLogger.info("Statistics Provider stopped.");
458 void startNodeHandlers(final Collection<NodeKey> addedNodes) {
459 for (NodeKey key : addedNodes) {
460 if (handlers.containsKey(key.getId())) {
461 spLogger.warn("Attempted to start already-existing handler for {}, very strange", key.getId());
465 final NodeStatisticsHandler h = new NodeStatisticsHandler(dps, key);
466 final NodeStatisticsHandler old = handlers.putIfAbsent(key.getId(), h);
468 spLogger.debug("Started node handler for {}", key.getId());
470 // FIXME: this should be in the NodeStatisticsHandler itself
471 sendStatisticsRequestsToNode(h);
473 spLogger.debug("Prevented race on handler for {}", key.getId());
478 void stopNodeHandlers(final Collection<NodeKey> removedNodes) {
479 for (NodeKey key : removedNodes) {
480 final NodeStatisticsHandler s = handlers.remove(key.getId());
482 spLogger.debug("Stopping node handler for {}", key.getId());
485 spLogger.warn("Attempted to remove non-existing handler for {}, very strange", key.getId());