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%2FShardTransactionChain.java;h=e7a181865e70c54917a272a6268704316111d13c;hb=67d58d1ab50f3c3bbe19a96fb6f0d9d94211829f;hp=42bd257ad1cdb97b3d28ab2588bbe6161894b8e9;hpb=758e3e3b16e73298221a78872149814baf735c7d;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChain.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChain.java index 42bd257ad1..e7a181865e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChain.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChain.java @@ -25,14 +25,16 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext; public class ShardTransactionChain extends AbstractUntypedActor { private final DOMStoreTransactionChain chain; - private final ShardContext shardContext; + private final DatastoreContext datastoreContext; private final SchemaContext schemaContext; + private final String shardName; public ShardTransactionChain(DOMStoreTransactionChain chain, SchemaContext schemaContext, - ShardContext shardContext) { + DatastoreContext datastoreContext,String shardName) { this.chain = chain; - this.shardContext = shardContext; + this.datastoreContext = datastoreContext; this.schemaContext = schemaContext; + this.shardName = shardName; } @Override @@ -58,17 +60,17 @@ public class ShardTransactionChain extends AbstractUntypedActor { TransactionProxy.TransactionType.READ_ONLY.ordinal()) { return getContext().actorOf( ShardTransaction.props( chain.newReadOnlyTransaction(), getShardActor(), - schemaContext, shardContext), transactionId); + schemaContext, datastoreContext,shardName), transactionId); } else if (createTransaction.getTransactionType() == TransactionProxy.TransactionType.READ_WRITE.ordinal()) { return getContext().actorOf( ShardTransaction.props( chain.newReadWriteTransaction(), getShardActor(), - schemaContext, shardContext), transactionId); + schemaContext, datastoreContext,shardName), transactionId); } else if (createTransaction.getTransactionType() == TransactionProxy.TransactionType.WRITE_ONLY.ordinal()) { return getContext().actorOf( ShardTransaction.props( chain.newWriteOnlyTransaction(), getShardActor(), - schemaContext, shardContext), transactionId); + schemaContext, datastoreContext,shardName), transactionId); } else { throw new IllegalArgumentException ( "CreateTransaction message has unidentified transaction type=" + @@ -85,27 +87,30 @@ public class ShardTransactionChain extends AbstractUntypedActor { } public static Props props(DOMStoreTransactionChain chain, SchemaContext schemaContext, - ShardContext shardContext) { - return Props.create(new ShardTransactionChainCreator(chain, schemaContext, shardContext)); + DatastoreContext datastoreContext, String shardName) { + return Props.create(new ShardTransactionChainCreator(chain, schemaContext, datastoreContext, shardName)); } private static class ShardTransactionChainCreator implements Creator { private static final long serialVersionUID = 1L; final DOMStoreTransactionChain chain; - final ShardContext shardContext; + final DatastoreContext datastoreContext; final SchemaContext schemaContext; + final String shardName; + ShardTransactionChainCreator(DOMStoreTransactionChain chain, SchemaContext schemaContext, - ShardContext shardContext) { + DatastoreContext datastoreContext, String shardName) { this.chain = chain; - this.shardContext = shardContext; + this.datastoreContext = datastoreContext; this.schemaContext = schemaContext; + this.shardName = shardName; } @Override public ShardTransactionChain create() throws Exception { - return new ShardTransactionChain(chain, schemaContext, shardContext); + return new ShardTransactionChain(chain, schemaContext, datastoreContext,shardName); } } }