X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fstatistics-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fstatistics%2Fmanager%2Fimpl%2FStatRpcMsgManagerImpl.java;h=e53f4941295f5a1891ad1e8dbdbf32ce2404d9b6;hb=531621aac4cff9d39cbd8668a53bdeba8a0e6d81;hp=80585548403f2ba2bf1b0e9498e26152acd6dace;hpb=d45e906a590d8ee44ea7957179aa378515d6ba47;p=controller.git diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatRpcMsgManagerImpl.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatRpcMsgManagerImpl.java index 8058554840..e53f494129 100644 --- a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatRpcMsgManagerImpl.java +++ b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatRpcMsgManagerImpl.java @@ -15,10 +15,8 @@ import java.util.concurrent.Future; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; import org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager; import org.opendaylight.controller.md.statistics.manager.StatisticsManager; -import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation; import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey; @@ -86,7 +84,6 @@ public class StatRpcMsgManagerImpl implements StatRpcMsgManager { private final long maxLifeForRequest = 50; /* 50 second */ private final int queueCapacity = 5000; - private final StatisticsManager manager; private final OpendaylightGroupStatisticsService groupStatsService; private final OpendaylightMeterStatisticsService meterStatsService; @@ -101,7 +98,7 @@ public class StatRpcMsgManagerImpl implements StatRpcMsgManager { public StatRpcMsgManagerImpl (final StatisticsManager manager, final RpcConsumerRegistry rpcRegistry, final long minReqNetMonitInt) { - this.manager = Preconditions.checkNotNull(manager, "StatisticManager can not be null!"); + Preconditions.checkArgument(manager != null, "StatisticManager can not be null!"); Preconditions.checkArgument(rpcRegistry != null, "RpcConsumerRegistry can not be null !"); groupStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightGroupStatisticsService.class), @@ -322,30 +319,26 @@ public class StatRpcMsgManagerImpl implements StatRpcMsgManager { @Override public void getAggregateFlowStat(final NodeRef nodeRef, final TableId tableId) { - - manager.enqueue(new StatDataStoreOperation() { + Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!"); + Preconditions.checkArgument(tableId != null, "TableId can not be null!"); + final RpcJobsQueue getAggregateFlowStat = new RpcJobsQueue() { @Override - public void applyOperation(final ReadWriteTransaction tx) { - final RpcJobsQueue getAggregateFlowStat = new RpcJobsQueue() { - @Override - public Void call() throws Exception { - final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder builder = - new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder(); - builder.setNode(nodeRef); - builder.setTableId(tableId); - - final TableBuilder tbuilder = new TableBuilder(); - tbuilder.setId(tableId.getValue()); - tbuilder.setKey(new TableKey(tableId.getValue())); - registrationRpcFutureCallBack(flowStatsService - .getAggregateFlowStatisticsFromFlowTableForAllFlows(builder.build()), tbuilder.build(), nodeRef); - return null; - } - }; - addGetAllStatJob(getAggregateFlowStat); + public Void call() throws Exception { + final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder builder = + new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder(); + builder.setNode(nodeRef); + builder.setTableId(tableId); + + final TableBuilder tbuilder = new TableBuilder(); + tbuilder.setId(tableId.getValue()); + tbuilder.setKey(new TableKey(tableId.getValue())); + registrationRpcFutureCallBack(flowStatsService + .getAggregateFlowStatisticsFromFlowTableForAllFlows(builder.build()), tbuilder.build(), nodeRef); + return null; } - }); + }; + addGetAllStatJob(getAggregateFlowStat); } @Override