Import MappingCheckedFuture from mdsal 94/64194/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 12 Oct 2017 09:44:51 +0000 (11:44 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 12 Oct 2017 11:31:20 +0000 (13:31 +0200)
yangtools is getting rid of references to CheckedFuture,
mdsal-common-api is the new place for this utility class.

Change-Id: Icaa2242fb29ba5c79a48a682c0f09f310499e322
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/AbstractForwardedTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/ConcurrentDOMDataBroker.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/RemoteProxyTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/SerializedDOMDataBroker.java

index 3d337d8..1184d39 100644 (file)
@@ -15,9 +15,9 @@ import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadTransaction;
+import org.opendaylight.mdsal.common.api.MappingCheckedFuture;
 import org.opendaylight.yangtools.concepts.Delegator;
 import org.opendaylight.yangtools.concepts.Identifiable;
-import org.opendaylight.yangtools.util.concurrent.MappingCheckedFuture;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
index 7e92787..6df7197 100644 (file)
@@ -34,8 +34,8 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.controller.md.sal.dom.broker.impl.TransactionCommitFailedExceptionMapper;
 import org.opendaylight.controller.sal.core.spi.data.DOMStore;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.common.api.MappingCheckedFuture;
 import org.opendaylight.yangtools.util.DurationStatisticsTracker;
-import org.opendaylight.yangtools.util.concurrent.MappingCheckedFuture;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -61,12 +61,12 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
     private final Executor clientFutureCallbackExecutor;
 
     public ConcurrentDOMDataBroker(final Map<LogicalDatastoreType, DOMStore> datastores,
-            Executor listenableFutureExecutor) {
+            final Executor listenableFutureExecutor) {
         this(datastores, listenableFutureExecutor, DurationStatisticsTracker.createConcurrent());
     }
 
     public ConcurrentDOMDataBroker(final Map<LogicalDatastoreType, DOMStore> datastores,
-            Executor listenableFutureExecutor, DurationStatisticsTracker commitStatsTracker) {
+            final Executor listenableFutureExecutor, final DurationStatisticsTracker commitStatsTracker) {
         super(datastores);
         this.clientFutureCallbackExecutor = Preconditions.checkNotNull(listenableFutureExecutor);
         this.commitStatsTracker = Preconditions.checkNotNull(commitStatsTracker);
@@ -77,8 +77,8 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
     }
 
     @Override
-    protected CheckedFuture<Void, TransactionCommitFailedException> submit(DOMDataWriteTransaction transaction,
-            Collection<DOMStoreThreePhaseCommitCohort> cohorts) {
+    protected CheckedFuture<Void, TransactionCommitFailedException> submit(final DOMDataWriteTransaction transaction,
+            final Collection<DOMStoreThreePhaseCommitCohort> cohorts) {
 
         Preconditions.checkArgument(transaction != null, "Transaction must not be null.");
         Preconditions.checkArgument(cohorts != null, "Cohorts must not be null.");
@@ -107,7 +107,7 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
         // Not using Futures.allAsList here to avoid its internal overhead.
         FutureCallback<Boolean> futureCallback = new FutureCallback<Boolean>() {
             @Override
-            public void onSuccess(Boolean result) {
+            public void onSuccess(final Boolean result) {
                 if (result == null || !result) {
                     handleException(clientSubmitFuture, transaction, cohorts, CAN_COMMIT, CAN_COMMIT_ERROR_MAPPER,
                             new TransactionCommitFailedException("Can Commit failed, no detailed cause available."));
@@ -120,7 +120,7 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
             }
 
             @Override
-            public void onFailure(Throwable failure) {
+            public void onFailure(final Throwable failure) {
                 handleException(clientSubmitFuture, transaction, cohorts, CAN_COMMIT, CAN_COMMIT_ERROR_MAPPER, failure);
             }
         };
@@ -138,7 +138,7 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
         // Not using Futures.allAsList here to avoid its internal overhead.
         FutureCallback<Void> futureCallback = new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void notUsed) {
+            public void onSuccess(final Void notUsed) {
                 if (!cohortIterator.hasNext()) {
                     // All cohorts completed successfully - we can move on to the commit phase
                     doCommit(startTime, clientSubmitFuture, transaction, cohorts);
@@ -149,7 +149,7 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
             }
 
             @Override
-            public void onFailure(Throwable failure) {
+            public void onFailure(final Throwable failure) {
                 handleException(clientSubmitFuture, transaction, cohorts, PRE_COMMIT, PRE_COMMIT_MAPPER, failure);
             }
         };
@@ -167,7 +167,7 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
         // Not using Futures.allAsList here to avoid its internal overhead.
         FutureCallback<Void> futureCallback = new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void notUsed) {
+            public void onSuccess(final Void notUsed) {
                 if (!cohortIterator.hasNext()) {
                     // All cohorts completed successfully - we're done.
                     commitStatsTracker.addDuration(System.nanoTime() - startTime);
@@ -180,7 +180,7 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
             }
 
             @Override
-            public void onFailure(Throwable throwable) {
+            public void onFailure(final Throwable throwable) {
                 handleException(clientSubmitFuture, transaction, cohorts, COMMIT, COMMIT_ERROR_MAPPER, throwable);
             }
         };
@@ -228,13 +228,13 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
         ListenableFuture<List<Void>> combinedFuture = Futures.allAsList(canCommitFutures);
         Futures.addCallback(combinedFuture, new FutureCallback<List<Void>>() {
             @Override
-            public void onSuccess(List<Void> notUsed) {
+            public void onSuccess(final List<Void> notUsed) {
                 // Propagate the original exception to the client.
                 LOG.debug("Tx: {} aborted successfully", transaction.getIdentifier());
             }
 
             @Override
-            public void onFailure(Throwable failure) {
+            public void onFailure(final Throwable failure) {
                 LOG.error("Tx: {} Error during Abort.", transaction.getIdentifier(), failure);
             }
         }, MoreExecutors.directExecutor());
@@ -259,7 +259,7 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
 
         private final Executor listenerExecutor;
 
-        AsyncNotifyingSettableFuture(Executor listenerExecutor) {
+        AsyncNotifyingSettableFuture(final Executor listenerExecutor) {
             this.listenerExecutor = Preconditions.checkNotNull(listenerExecutor);
         }
 
@@ -287,7 +287,7 @@ public class ConcurrentDOMDataBroker extends AbstractDOMBroker {
         }
 
         @Override
-        protected boolean setException(Throwable throwable) {
+        protected boolean setException(final Throwable throwable) {
             ON_TASK_COMPLETION_THREAD_TL.set(Boolean.TRUE);
             try {
                 return super.setException(throwable);
index 3120f6f..3063a35 100644 (file)
@@ -40,8 +40,8 @@ import org.opendaylight.controller.cluster.access.concepts.RequestFailure;
 import org.opendaylight.controller.cluster.access.concepts.Response;
 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
 import org.opendaylight.controller.cluster.datastore.util.AbstractDataTreeModificationCursor;
+import org.opendaylight.mdsal.common.api.MappingCheckedFuture;
 import org.opendaylight.mdsal.common.api.ReadFailedException;
-import org.opendaylight.yangtools.util.concurrent.MappingCheckedFuture;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
index f91da9a..19de5e1 100644 (file)
@@ -39,7 +39,7 @@ import org.opendaylight.controller.cluster.datastore.utils.NormalizedNodeAggrega
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.controller.sal.core.spi.data.AbstractDOMStoreTransaction;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
-import org.opendaylight.yangtools.util.concurrent.MappingCheckedFuture;
+import org.opendaylight.mdsal.common.api.MappingCheckedFuture;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
index 209dfdc..e589e87 100644 (file)
@@ -21,8 +21,8 @@ import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFaile
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.controller.sal.core.spi.data.DOMStore;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.common.api.MappingCheckedFuture;
 import org.opendaylight.yangtools.util.DurationStatisticsTracker;
-import org.opendaylight.yangtools.util.concurrent.MappingCheckedFuture;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.