*
* @author avishnoi@in.ibm.com
*/
-public class NodeStatisticsHandler {
+public class NodeStatisticsHandler implements AutoCloseable {
private static final Logger logger = LoggerFactory.getLogger(NodeStatisticsHandler.class);
private static final int NUMBER_OF_WAIT_CYCLES = 2;
this.targetNodeIdentifier = InstanceIdentifier.builder(Nodes.class).child(Node.class, targetNodeKey).build();
}
- public class FlowEntry {
+ private static class FlowEntry {
private final Short tableId;
private final Flow flow;
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + getOuterType().hashCode();
result = prime * result + ((flow == null) ? 0 : flow.hashCode());
result = prime * result + ((tableId == null) ? 0 : tableId.hashCode());
return result;
if (getClass() != obj.getClass())
return false;
FlowEntry other = (FlowEntry) obj;
- if (!getOuterType().equals(other.getOuterType()))
- return false;
if (flow == null) {
if (other.flow != null)
return false;
return false;
return true;
}
-
- private NodeStatisticsHandler getOuterType() {
- return NodeStatisticsHandler.this;
- }
}
private static final class QueueEntry{
InstanceIdentifier<?> nodeGroupStatisticsAugmentation = groupRef.augmentation(NodeGroupStatistics.class).toInstance();
trans.removeOperationalData(nodeGroupStatisticsAugmentation);
}
+
+ @Override
+ public void close() {
+ // FIXME: cleanup any resources we hold (registrations, etc.)
+ logger.debug("Statistics handler for {} shut down", targetNodeKey.getId());
+ }
}