Migrate ListenableFutures.addErrorLogging() users
[netvirt.git] / statistics / impl / src / main / java / org / opendaylight / netvirt / statistics / StatisticsImpl.java
index 6b86e9f64172817b9883079e551cf99847d5c5af..098442d513fe0588c7cd1ecbf1bfb684e1b92a2d 100644 (file)
@@ -34,7 +34,7 @@ import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
 import org.opendaylight.genius.mdsalutil.MDSALUtil;
 import org.opendaylight.genius.mdsalutil.MatchInfoBase;
 import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
 import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
@@ -235,7 +235,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
         String requestKey = String.valueOf(intRequestKey);
         SettableFuture<RpcResult<AcquireElementCountersRequestHandlerOutput>> result = SettableFuture.create();
 
-        ListenableFutures.addErrorLogging(
+        LoggingFutures.addErrorLogging(
             txRunner.callWithNewReadWriteTransactionAndSubmit(transaction -> {
                 if (input.getIncomingTraffic() != null) {
                     Optional<EgressElementCountersRequestConfig> eecrcOpt =
@@ -310,7 +310,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
                         .child(CounterRequests.class, new CounterRequestsKey(input.getHandler())).build();
 
         SettableFuture<RpcResult<ReleaseElementCountersRequestHandlerOutput>> result = SettableFuture.create();
-        ListenableFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(tx -> {
+        LoggingFutures.addErrorLogging(txRunner.callWithNewReadWriteTransactionAndSubmit(tx -> {
             Optional<IngressElementCountersRequestConfig> iecrcOpt =
                     tx.read(LogicalDatastoreType.CONFIGURATION, CountersServiceUtils.IECRC_IDENTIFIER).get();
             Optional<EgressElementCountersRequestConfig> eecrcOpt =
@@ -544,7 +544,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
     }
 
     private void deleteCounterRequest(CounterRequests counterRequest, ElementCountersDirection direction) {
-        ListenableFutures.addErrorLogging(
+        LoggingFutures.addErrorLogging(
             txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
                 if (ElementCountersDirection.INGRESS.equals(direction)) {
                     tx.delete(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier
@@ -580,7 +580,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
     }
 
     private void initializeCountrsConfigDataSrore() {
-        ListenableFutures.addErrorLogging(
+        LoggingFutures.addErrorLogging(
             txRunner.callWithNewReadWriteTransactionAndSubmit(transaction -> {
                 Optional<IngressElementCountersRequestConfig> iecrcOpt =
                         transaction.read(LogicalDatastoreType.CONFIGURATION,
@@ -908,7 +908,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
         EgressElementCountersRequestConfigBuilder ecrcb = new EgressElementCountersRequestConfigBuilder();
         ecrcb.setCounterRequests(counterRequests);
         requestConfig = ecrcb.build();
-        transaction.put(LogicalDatastoreType.CONFIGURATION, ecrcIdentifier, requestConfig);
+        transaction.mergeParentStructurePut(LogicalDatastoreType.CONFIGURATION, ecrcIdentifier, requestConfig);
     }
 
     private void creatIngressEelementCountersContainerInConfig(ReadWriteTransaction transaction,
@@ -917,7 +917,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
         List<CounterRequests> counterRequests = new ArrayList<>();
         iecrcb.setCounterRequests(counterRequests);
         IngressElementCountersRequestConfig iecrc = iecrcb.build();
-        transaction.put(LogicalDatastoreType.CONFIGURATION, ecrcIdentifier, iecrc);
+        transaction.mergeParentStructurePut(LogicalDatastoreType.CONFIGURATION, ecrcIdentifier, iecrc);
     }
 
     private void creatEgressEelementCountersContainerInConfig(ReadWriteTransaction transaction,
@@ -926,7 +926,7 @@ public class StatisticsImpl implements StatisticsService, ICountersInterfaceChan
         List<CounterRequests> counterRequests = new ArrayList<>();
         eecrcb.setCounterRequests(counterRequests);
         EgressElementCountersRequestConfig eecrc = eecrcb.build();
-        transaction.put(LogicalDatastoreType.CONFIGURATION, ecrcIdentifier, eecrc);
+        transaction.mergeParentStructurePut(LogicalDatastoreType.CONFIGURATION, ecrcIdentifier, eecrc);
     }
 
     private Integer allocateId(String idKey) {