X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FDebugThreePhaseCommitCohort.java;h=a2a2bfca0850e746e045f561d1db0d6f5635732c;hb=b5cb353e3553a39f576c284119af75ffa5ea66a9;hp=12778541008b5eb84580be5ef1e828c1b091f428;hpb=925cb4a228d0fda99c7bfeb432eb25285a223887;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DebugThreePhaseCommitCohort.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DebugThreePhaseCommitCohort.java index 1277854100..a2a2bfca08 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DebugThreePhaseCommitCohort.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DebugThreePhaseCommitCohort.java @@ -12,6 +12,7 @@ import com.google.common.base.Preconditions; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.MoreExecutors; import java.util.List; import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.slf4j.Logger; @@ -32,26 +33,26 @@ class DebugThreePhaseCommitCohort extends AbstractThreePhaseCommitCohort private final TransactionIdentifier transactionId; private Logger log = LOG; - DebugThreePhaseCommitCohort(TransactionIdentifier transactionId, AbstractThreePhaseCommitCohort delegate, - Throwable debugContext) { + DebugThreePhaseCommitCohort(final TransactionIdentifier transactionId, + final AbstractThreePhaseCommitCohort delegate, final Throwable debugContext) { this.delegate = Preconditions.checkNotNull(delegate); this.debugContext = Preconditions.checkNotNull(debugContext); this.transactionId = Preconditions.checkNotNull(transactionId); } - private ListenableFuture addFutureCallback(ListenableFuture future) { + private ListenableFuture addFutureCallback(final ListenableFuture future) { Futures.addCallback(future, new FutureCallback() { @Override - public void onSuccess(V result) { + public void onSuccess(final V result) { // no-op } @Override - public void onFailure(Throwable failure) { + public void onFailure(final Throwable failure) { log.warn("Transaction {} failed with error \"{}\" - was allocated in the following context", transactionId, failure, debugContext); } - }); + }, MoreExecutors.directExecutor()); return future; } @@ -83,7 +84,7 @@ class DebugThreePhaseCommitCohort extends AbstractThreePhaseCommitCohort } @VisibleForTesting - void setLogger(Logger log) { + void setLogger(final Logger log) { this.log = log; } }