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%2FNoOpTransactionContext.java;h=2094cd2f77ff1a8399f88ce0bb4247603c484cb3;hb=30507b196fa240a4176ba12102ac0469280feff9;hp=450716800066a291d00e2b22b71a4c6306dfadaf;hpb=6823ef1fd8f0a2f7ea39a2e85276a73e5de0bf72;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/NoOpTransactionContext.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/NoOpTransactionContext.java index 4507168000..2094cd2f77 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/NoOpTransactionContext.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/NoOpTransactionContext.java @@ -10,8 +10,6 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorSelection; import com.google.common.base.Optional; import com.google.common.util.concurrent.SettableFuture; -import java.util.concurrent.Semaphore; - import org.opendaylight.controller.cluster.datastore.exceptions.NoShardLeaderException; import org.opendaylight.controller.cluster.datastore.identifiers.TransactionIdentifier; import org.opendaylight.controller.md.sal.common.api.data.DataStoreUnavailableException; @@ -26,12 +24,10 @@ final class NoOpTransactionContext extends AbstractTransactionContext { private static final Logger LOG = LoggerFactory.getLogger(NoOpTransactionContext.class); private final Throwable failure; - private final Semaphore operationLimiter; - public NoOpTransactionContext(Throwable failure, TransactionIdentifier identifier, Semaphore operationLimiter) { + public NoOpTransactionContext(Throwable failure, TransactionIdentifier identifier) { super(identifier); this.failure = failure; - this.operationLimiter = operationLimiter; } @Override @@ -47,41 +43,36 @@ final class NoOpTransactionContext extends AbstractTransactionContext { @Override public Future directCommit() { LOG.debug("Tx {} directCommit called, failure: {}", getIdentifier(), failure); - operationLimiter.release(); return akka.dispatch.Futures.failed(failure); } @Override public Future readyTransaction() { LOG.debug("Tx {} readyTransaction called, failure: {}", getIdentifier(), failure); - operationLimiter.release(); return akka.dispatch.Futures.failed(failure); } @Override public void deleteData(YangInstanceIdentifier path) { LOG.debug("Tx {} deleteData called path = {}", getIdentifier(), path); - operationLimiter.release(); } @Override public void mergeData(YangInstanceIdentifier path, NormalizedNode data) { LOG.debug("Tx {} mergeData called path = {}", getIdentifier(), path); - operationLimiter.release(); } @Override public void writeData(YangInstanceIdentifier path, NormalizedNode data) { LOG.debug("Tx {} writeData called path = {}", getIdentifier(), path); - operationLimiter.release(); } @Override public void readData(final YangInstanceIdentifier path, SettableFuture>> proxyFuture) { LOG.debug("Tx {} readData called path = {}", getIdentifier(), path); - operationLimiter.release(); - Throwable t; - if(failure instanceof NoShardLeaderException) { + + final Throwable t; + if (failure instanceof NoShardLeaderException) { t = new DataStoreUnavailableException(failure.getMessage(), failure); } else { t = failure; @@ -92,7 +83,6 @@ final class NoOpTransactionContext extends AbstractTransactionContext { @Override public void dataExists(YangInstanceIdentifier path, SettableFuture proxyFuture) { LOG.debug("Tx {} dataExists called path = {}", getIdentifier(), path); - operationLimiter.release(); proxyFuture.setException(new ReadFailedException("Error checking exists for path " + path, failure)); } }