- private void sendAggregateFlowsStatsFromAllTablesRequest(final NodeKey nodeKey) throws InterruptedException, ExecutionException{
- FlowCapableNode node = (FlowCapableNode)dps.readOperationalData(
- InstanceIdentifier.builder(Nodes.class).child(Node.class,nodeKey).augmentation(FlowCapableNode.class).build());
- if (node != null) {
- final List<Table> tables = node.getTable();
- if (tables != null) {
- spLogger.debug("Node {} supports {} table(s)", nodeKey, tables.size());
- for(Table table : tables) {
- sendAggregateFlowsStatsFromTableRequest(nodeKey, table.getId());
- }
- } else {
- spLogger.debug("Node {} has no associated tables", nodeKey);
- }
- } else {
- spLogger.debug("Node {} not found", nodeKey);
+ private void sendAggregateFlowsStatsFromAllTablesRequest(final NodeStatisticsHandler h) throws InterruptedException, ExecutionException{
+ final Collection<TableKey> tables = h.getKnownTables();
+ spLogger.debug("Node {} supports {} table(s)", h, tables.size());
+
+ for (TableKey key : h.getKnownTables()) {
+ sendAggregateFlowsStatsFromTableRequest(h.getTargetNodeKey(), key.getId().shortValue());