Handle 3PC message backwards compatibility 86/33386/4
authorTom Pantelis <tpanteli@brocade.com>
Fri, 22 Jan 2016 19:03:04 +0000 (14:03 -0500)
committerTony Tkacik <ttkacik@cisco.com>
Mon, 1 Feb 2016 16:52:52 +0000 (16:52 +0000)
commit0281535ab08fd795e42df66d25e9a904ff941ad7
treedda5c1ea17b6f3f47b203ec58380d36e7444aaea
parent5a4560d475f0ed328275f1a5c7a5dae292acfb02
Handle 3PC message backwards compatibility

Modified the ThreePhaseCommitCohortProxy to send the appropriate 3PC
messages based on the backend cohort actor's version. The version is
supplied via a new CohortInfo class which also holds the existing cohort
ActorSelection Future. The caller actually specifies a Supplier to
obtain the version b/c the version may not be known until the
ActorSelection Future is known. The TransactionProxy passes a Supplier
which obtains the version from the TransactionContext. As a result, the
ThreePhaseCommitCohortProxy was refactored a bit to handle the CohortInfo
instances.

The ThreePhaseCommitCohortProxyTest was refactored to use real actors for
the cohorts instead of mocking messages via a mocked ActorContext.

Modified the ShardCommitCoordinator to return the appropriate versioned
replies.

Change-Id: I13e6acf81c1fe8abda43c30b1a73648e411ab500
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
12 files changed:
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardCommitCoordinator.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/SingleCommitCohortProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/compat/PreBoronShardTest.java