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%2FTransactionContext.java;h=d9a53ab29189b47e004623bb5938841a6affa34e;hb=b681508d95a7897da263a92f7e3f0aff0adecb33;hp=ab636ff493c724c3daa4f69eea6d5fb7d591847c;hpb=74926cb05f2e5e4937658ca61444f7d7c846eb00;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContext.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContext.java index ab636ff493..d9a53ab291 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContext.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContext.java @@ -9,6 +9,8 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorSelection; import com.google.common.util.concurrent.SettableFuture; +import java.util.Optional; +import java.util.SortedSet; import org.opendaylight.controller.cluster.datastore.messages.AbstractRead; import org.opendaylight.controller.cluster.datastore.modification.AbstractModification; import scala.concurrent.Future; @@ -20,29 +22,31 @@ import scala.concurrent.Future; interface TransactionContext { void closeTransaction(); - Future readyTransaction(); + Future readyTransaction(Boolean havePermit, Optional> participatingShardNames); - void executeModification(AbstractModification modification); + void executeModification(AbstractModification modification, Boolean havePermit); - void executeRead(AbstractRead readCmd, SettableFuture promise); + void executeRead(AbstractRead readCmd, SettableFuture promise, Boolean havePermit); - boolean supportsDirectCommit(); - - Future directCommit(); + Future directCommit(Boolean havePermit); /** * Invoked by {@link TransactionContextWrapper} when it has finished handing * off operations to this context. From this point on, the context is responsible * for throttling operations. * + *

* Implementations can rely on the wrapper calling this operation in a synchronized * block, so they do not need to ensure visibility of this state transition themselves. */ void operationHandOffComplete(); /** - * A TransactionContext that uses Operation limiting should return true else false - * @return + * A TransactionContext that uses operation limiting should return true else false. + * + * @return true if operation limiting is used, false otherwise */ boolean usesOperationLimiting(); + + short getTransactionVersion(); }