Change wrong parameters and variables.
- checkstyle issues
Change-Id: If7552c83e0f6aac6ac332cdbc592c7f5b6ff4fe3
Signed-off-by: Jozef Bacigal <jozef.bacigal@pantheon.tech>
import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.FutureFallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.JdkFutureAdapters;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.JdkFutureAdapters;
import com.google.common.util.concurrent.ListenableFuture;
wholeProcessEventIdentifier = new EventIdentifier(type.toString(), deviceInfo.getNodeId().getValue());
EventsTimeCounter.markStart(wholeProcessEventIdentifier);
}
wholeProcessEventIdentifier = new EventIdentifier(type.toString(), deviceInfo.getNodeId().getValue());
EventsTimeCounter.markStart(wholeProcessEventIdentifier);
}
- final EventIdentifier ofpQueuToRequestContextEventIdentifier
+ final EventIdentifier ofpQueueToRequestContextEventIdentifier
= new EventIdentifier(QUEUE2_REQCTX + type.toString(), deviceInfo.getNodeId().toString());
final ListenableFuture<RpcResult<List<MultipartReply>>> statisticsDataInFuture =
JdkFutureAdapters.listenInPoolThread(statisticsGatheringService.getStatisticsOfType(
= new EventIdentifier(QUEUE2_REQCTX + type.toString(), deviceInfo.getNodeId().toString());
final ListenableFuture<RpcResult<List<MultipartReply>>> statisticsDataInFuture =
JdkFutureAdapters.listenInPoolThread(statisticsGatheringService.getStatisticsOfType(
- ofpQueuToRequestContextEventIdentifier, type));
+ ofpQueueToRequestContextEventIdentifier, type));
return transformAndStoreStatisticsData(
statisticsDataInFuture,
deviceInfo,
return transformAndStoreStatisticsData(
statisticsDataInFuture,
deviceInfo,
/**
* Method extracts flow statistics out of flowAndStatistics model.
*
/**
* Method extracts flow statistics out of flowAndStatistics model.
*
+ * @param flowAndStats flow statistics map list
*/
private static FlowStatisticsDataBuilder refineFlowStatisticsAugmentation(
final FlowAndStatisticsMapList flowAndStats) {
*/
private static FlowStatisticsDataBuilder refineFlowStatisticsAugmentation(
final FlowAndStatisticsMapList flowAndStats) {
LogicalDatastoreType.OPERATIONAL, flowCapableNodePath);
/* we wish to close readTx for fallBack */
LogicalDatastoreType.OPERATIONAL, flowCapableNodePath);
/* we wish to close readTx for fallBack */
- Futures.withFallback(flowCapableNodeFuture, new FutureFallback<Optional<FlowCapableNode>>() {
-
- @Override
- public ListenableFuture<Optional<FlowCapableNode>> create(final Throwable t) throws Exception {
- readTx.close();
- return Futures.immediateFailedFuture(t);
- }
+ Futures.withFallback(flowCapableNodeFuture, t -> {
+ readTx.close();
+ return Futures.immediateFailedFuture(t);
});
/*
* we have to read actual tables with all information before we set empty Flow list, merge is expensive and
* not applicable for lists
*/
});
/*
* we have to read actual tables with all information before we set empty Flow list, merge is expensive and
* not applicable for lists
*/
- return Futures.transform(flowCapableNodeFuture, new AsyncFunction<Optional<FlowCapableNode>, Void>() {
-
- @Override
- public ListenableFuture<Void> apply(final Optional<FlowCapableNode> flowCapNodeOpt) throws Exception {
+ return Futures.transform(
+ flowCapableNodeFuture, (AsyncFunction<Optional<FlowCapableNode>, Void>) flowCapNodeOpt -> {
if (flowCapNodeOpt.isPresent()) {
for (final Table tableData : flowCapNodeOpt.get().getTable()) {
final Table table = new TableBuilder(tableData).setFlow(Collections.<Flow>emptyList()).build();
if (flowCapNodeOpt.isPresent()) {
for (final Table tableData : flowCapNodeOpt.get().getTable()) {
final Table table = new TableBuilder(tableData).setFlow(Collections.<Flow>emptyList()).build();
}
readTx.close();
return Futures.immediateFuture(null);
}
readTx.close();
return Futures.immediateFuture(null);
}
private static void processQueueStatistics(
}
private static void processQueueStatistics(
final TxFacade txFacade) throws Exception {
final InstanceIdentifier<Node> nodeIdent = deviceInfo.getNodeInstanceIdentifier();
for (final NodeConnectorStatisticsUpdate nodeConnectorStatisticsUpdate : data) {
final TxFacade txFacade) throws Exception {
final InstanceIdentifier<Node> nodeIdent = deviceInfo.getNodeInstanceIdentifier();
for (final NodeConnectorStatisticsUpdate nodeConnectorStatisticsUpdate : data) {
- for (final NodeConnectorStatisticsAndPortNumberMap nConnectPort :
+ for (final NodeConnectorStatisticsAndPortNumberMap nodeConnectPort :
nodeConnectorStatisticsUpdate.getNodeConnectorStatisticsAndPortNumberMap()) {
final FlowCapableNodeConnectorStatistics stats
nodeConnectorStatisticsUpdate.getNodeConnectorStatisticsAndPortNumberMap()) {
final FlowCapableNodeConnectorStatistics stats
- = new FlowCapableNodeConnectorStatisticsBuilder(nConnectPort).build();
- final NodeConnectorKey key = new NodeConnectorKey(nConnectPort.getNodeConnectorId());
+ = new FlowCapableNodeConnectorStatisticsBuilder(nodeConnectPort).build();
+ final NodeConnectorKey key = new NodeConnectorKey(nodeConnectPort.getNodeConnectorId());
final InstanceIdentifier<NodeConnector> nodeConnectorIdent = nodeIdent.child(NodeConnector.class, key);
final InstanceIdentifier<FlowCapableNodeConnectorStatisticsData> nodeConnStatIdent = nodeConnectorIdent
.augmentation(FlowCapableNodeConnectorStatisticsData.class);
final InstanceIdentifier<NodeConnector> nodeConnectorIdent = nodeIdent.child(NodeConnector.class, key);
final InstanceIdentifier<FlowCapableNodeConnectorStatisticsData> nodeConnStatIdent = nodeConnectorIdent
.augmentation(FlowCapableNodeConnectorStatisticsData.class);
final TxFacade txFacade) throws Exception {
final InstanceIdentifier<FlowCapableNode> fNodeIdent = assembleFlowCapableNodeInstanceIdentifier(deviceInfo);
for (final MeterStatisticsUpdated meterStatisticsUpdated : data) {
final TxFacade txFacade) throws Exception {
final InstanceIdentifier<FlowCapableNode> fNodeIdent = assembleFlowCapableNodeInstanceIdentifier(deviceInfo);
for (final MeterStatisticsUpdated meterStatisticsUpdated : data) {
- for (final MeterStats mStat : meterStatisticsUpdated.getMeterStats()) {
- final MeterStatistics stats = new MeterStatisticsBuilder(mStat).build();
- final MeterId meterId = mStat.getMeterId();
+ for (final MeterStats meterStats : meterStatisticsUpdated.getMeterStats()) {
+ final MeterStatistics stats = new MeterStatisticsBuilder(meterStats).build();
+ final MeterId meterId = meterStats.getMeterId();
final InstanceIdentifier<Meter> meterIdent = fNodeIdent.child(Meter.class, new MeterKey(meterId));
final InstanceIdentifier<NodeMeterStatistics> nodeMeterStatIdent = meterIdent
.augmentation(NodeMeterStatistics.class);
final InstanceIdentifier<Meter> meterIdent = fNodeIdent.child(Meter.class, new MeterKey(meterId));
final InstanceIdentifier<NodeMeterStatistics> nodeMeterStatIdent = meterIdent
.augmentation(NodeMeterStatistics.class);
private static void deleteAllKnownMeters(
final DeviceMeterRegistry meterRegistry,
private static void deleteAllKnownMeters(
final DeviceMeterRegistry meterRegistry,
- final InstanceIdentifier<FlowCapableNode> fNodeIdent,
+ final InstanceIdentifier<FlowCapableNode> flowNodeIdent,
final TxFacade txFacade) throws Exception {
for (final MeterId meterId : meterRegistry.getAllMeterIds()) {
final TxFacade txFacade) throws Exception {
for (final MeterId meterId : meterRegistry.getAllMeterIds()) {
- final InstanceIdentifier<Meter> meterIdent = fNodeIdent.child(Meter.class, new MeterKey(meterId));
+ final InstanceIdentifier<Meter> meterIdent = flowNodeIdent.child(Meter.class, new MeterKey(meterId));
txFacade.addDeleteToTxChain(LogicalDatastoreType.OPERATIONAL, meterIdent);
}
meterRegistry.removeMarked();
txFacade.addDeleteToTxChain(LogicalDatastoreType.OPERATIONAL, meterIdent);
}
meterRegistry.removeMarked();
private static void deleteAllKnownGroups(
final TxFacade txFacade,
private static void deleteAllKnownGroups(
final TxFacade txFacade,
- final InstanceIdentifier<FlowCapableNode> fNodeIdent,
+ final InstanceIdentifier<FlowCapableNode> flowNodeIdent,
final DeviceGroupRegistry groupRegistry) throws Exception {
for (final GroupId groupId : groupRegistry.getAllGroupIds()) {
final DeviceGroupRegistry groupRegistry) throws Exception {
for (final GroupId groupId : groupRegistry.getAllGroupIds()) {
- final InstanceIdentifier<Group> groupIdent = fNodeIdent.child(Group.class, new GroupKey(groupId));
+ final InstanceIdentifier<Group> groupIdent = flowNodeIdent.child(Group.class, new GroupKey(groupId));
txFacade.addDeleteToTxChain(LogicalDatastoreType.OPERATIONAL, groupIdent);
}
groupRegistry.removeMarked();
txFacade.addDeleteToTxChain(LogicalDatastoreType.OPERATIONAL, groupIdent);
}
groupRegistry.removeMarked();