Return local shard's DataTree from ActorContext#findPrimaryShardAsync 83/18783/3
authorTom Pantelis <tpanteli@brocade.com>
Tue, 21 Apr 2015 21:03:23 +0000 (17:03 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Thu, 23 Apr 2015 04:35:24 +0000 (00:35 -0400)
commit9d77fd7cf8aa00f063ed4a7875738f53b92518e9
treed19c17a60e40ab7a6baea198de91feea9df2e8af
parente20fff4d018e95cefd1934d2be31e5cd692fe7fa
Return local shard's DataTree from ActorContext#findPrimaryShardAsync

For upcoming patches to optimize local shard transactions, we need
access to the Shard's local DataTree in the TransactionProxy. This can
be returned by ActorContext#findPrimaryShardAsync along with the shard's
ActorSelection.

I added a new class PrimaryShardInfo that encapsulates the shard's
ActorSelection and an Optional whose value contains the Shard's DataTree
if the shard actor is local to the caller.

ActorContext#findPrimaryShardAsync now returns a Future<PrimaryShardInfo>.
Currently, the PrimaryShardInfo contains an absent Optional but will be
implemented to contain the local Shard's DataTree in a subsequent patch.
Another subsequent patch will utilize the DataTree in the
TransactionProxy.

Change-Id: I9bd6425d597c307391d09554fe9ccebd03593180
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ChainedTransactionProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/PrimaryShardInfo.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java