+ if(portStatsService != null){
+ sendAllNodeConnectorsStatisticsRequest(h);
+ }
+ if(groupStatsService != null){
+ sendAllGroupStatisticsRequest(h);
+ sendGroupDescriptionRequest(h);
+ }
+ if(meterStatsService != null){
+ sendAllMeterStatisticsRequest(h);
+ sendMeterConfigStatisticsRequest(h);
+ }
+ if(queueStatsService != null){
+ sendAllQueueStatsFromAllNodeConnector(h);
+ }
+ }catch(Exception e){
+ spLogger.error("Exception occured while sending statistics requests : {}", e);
+ }
+ }
+
+
+ private void sendAllFlowTablesStatisticsRequest(NodeStatisticsHandler h) throws InterruptedException, ExecutionException {
+ final GetFlowTablesStatisticsInputBuilder input =
+ new GetFlowTablesStatisticsInputBuilder();
+
+ input.setNode(h.getTargetNodeRef());
+
+ Future<RpcResult<GetFlowTablesStatisticsOutput>> response =
+ flowTableStatsService.getFlowTablesStatistics(input.build());
+
+ h.recordExpectedTransaction(response.get().getResult().getTransactionId(), StatsRequestType.ALL_FLOW_TABLE);
+ }
+
+ private void sendAllFlowsStatsFromAllTablesRequest(NodeStatisticsHandler h) throws InterruptedException, ExecutionException{
+ final GetAllFlowsStatisticsFromAllFlowTablesInputBuilder input =
+ new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder();
+
+ input.setNode(h.getTargetNodeRef());
+
+ Future<RpcResult<GetAllFlowsStatisticsFromAllFlowTablesOutput>> response =
+ flowStatsService.getAllFlowsStatisticsFromAllFlowTables(input.build());
+
+ h.recordExpectedTransaction(response.get().getResult().getTransactionId(), StatsRequestType.ALL_FLOW);
+ }
+
+ public void sendFlowStatsFromTableRequest(NodeKey node, Flow flow) throws InterruptedException, ExecutionException {
+ final NodeStatisticsHandler h = getStatisticsHandler(node.getId());
+ if (h != null) {
+ sendFlowStatsFromTableRequest(h, flow);
+ }
+ }
+
+ private void sendFlowStatsFromTableRequest(NodeStatisticsHandler h, Flow flow) throws InterruptedException, ExecutionException{
+ final GetFlowStatisticsFromFlowTableInputBuilder input =
+ new GetFlowStatisticsFromFlowTableInputBuilder(flow);
+
+ input.setNode(h.getTargetNodeRef());
+
+ Future<RpcResult<GetFlowStatisticsFromFlowTableOutput>> response =
+ flowStatsService.getFlowStatisticsFromFlowTable(input.build());
+
+ h.recordExpectedTransaction(response.get().getResult().getTransactionId(), StatsRequestType.ALL_FLOW);
+ }
+
+ 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, key.getId().shortValue());