X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FTransactionContext.java;h=d9a53ab29189b47e004623bb5938841a6affa34e;hp=bc6e5f229fe04aacffd8e719c138ba394b27bbd8;hb=c9587253579a7b34f4c397a254f83890d4d3ba03;hpb=f89552de4942d3709d6ee84415e672c6c7de489f 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 bc6e5f229f..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 @@ -8,10 +8,11 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorSelection; -import com.google.common.base.Optional; import com.google.common.util.concurrent.SettableFuture; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +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; /* @@ -21,15 +22,31 @@ import scala.concurrent.Future; interface TransactionContext { void closeTransaction(); - Future readyTransaction(); + Future readyTransaction(Boolean havePermit, Optional> participatingShardNames); - void writeData(YangInstanceIdentifier path, NormalizedNode data); + void executeModification(AbstractModification modification, Boolean havePermit); - void deleteData(YangInstanceIdentifier path); + void executeRead(AbstractRead readCmd, SettableFuture promise, Boolean havePermit); - void mergeData(YangInstanceIdentifier path, NormalizedNode data); + Future directCommit(Boolean havePermit); - void readData(final YangInstanceIdentifier path, SettableFuture>> proxyFuture); + /** + * 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(); - void dataExists(YangInstanceIdentifier path, SettableFuture proxyFuture); + /** + * A TransactionContext that uses operation limiting should return true else false. + * + * @return true if operation limiting is used, false otherwise + */ + boolean usesOperationLimiting(); + + short getTransactionVersion(); }