use of org.opendaylight.infrautils.utils.UncheckedCloseable in project genius by opendaylight.
the class NodeConnectorStatsImpl method remove.
@Override
protected void remove(InstanceIdentifier<Node> identifier, Node node) {
NodeId nodeId = node.getId();
String nodeVal = nodeId.getValue().split(":")[1];
BigInteger dpId = new BigInteger(nodeVal);
if (nodes.contains(dpId)) {
nodes.remove(dpId);
// remove counters set from node
Set<Counter> nodeMetricCounterSet = metricsCountersPerNodeMap.remove(dpId);
if (nodeMetricCounterSet != null) {
// remove counters
nodeMetricCounterSet.forEach(UncheckedCloseable::close);
}
}
if (nodes.size() > 0) {
delayStatsQuery = ifmConfig.getIfmStatsDefPollInterval() / nodes.size();
} else {
stopPortStatRequestTask();
delayStatsQuery = 0;
}
}
Aggregations