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=e5130ed6dc78df0420bc811c4c18546df139db0b;hb=d71b6614d6cdb5a98f086edeb56f5c52f365c61c;hp=b6af31e641ce48e95903f935984181340a9eaf72;hpb=37f0504d391efd8b7d61403759fcc22a6dd3a093;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 b6af31e641..e5130ed6dc 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,9 +9,7 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorSelection; import com.google.common.base.Optional; -import com.google.common.util.concurrent.CheckedFuture; -import java.util.List; -import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException; +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 scala.concurrent.Future; @@ -31,10 +29,21 @@ interface TransactionContext { void mergeData(YangInstanceIdentifier path, NormalizedNode data); - CheckedFuture>, ReadFailedException> readData( - final YangInstanceIdentifier path); + void readData(final YangInstanceIdentifier path, SettableFuture>> proxyFuture); - CheckedFuture dataExists(YangInstanceIdentifier path); + void dataExists(YangInstanceIdentifier path, SettableFuture proxyFuture); - List> getRecordedOperationFutures(); -} \ No newline at end of file + boolean supportsDirectCommit(); + + Future directCommit(); + + /** + * 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(); +}