BUG-5280: eliminate ShardTransactionIdentifier 15/39015/25
authorRobert Varga <rovarga@cisco.com>
Tue, 17 May 2016 21:21:58 +0000 (23:21 +0200)
committerRobert Varga <rovarga@cisco.com>
Mon, 6 Jun 2016 13:43:44 +0000 (15:43 +0200)
commit4062f5241a2a6f58ffb83dd1e9939ee66122d217
tree679213f5cc10f84b279c34604ea61c1a48ee94af
parentd0621d28e507d9f6c0b9445d197f90253d34725d
BUG-5280: eliminate ShardTransactionIdentifier

This is very simple wrapper class which has two functions:
- carries a String transaction identifier (making it available)
- prepends it with 'shard-' in its toString() method

Analyzing the actual uses of this class revealed that the toString()
is called only when instantiating an actor, at which point either
the transaction identifier is already present, or a transaction
identifier is actually available through AbstractShardDataTreeTransaction.

The second case is actually not entirely accurate, as for the case
of remotely-created transactions we will actually use the actor name
for the transaction name, hence adding to the overall string-induced
confusion.

Moving the toString() method towards actor instantiation removes
the need to pass this class around and we can pass down normal
transaction identifiers.

This newfound unification allows us to eliminate duplication
in the Shard*Transaction classes, which can pick the identifier
from AbstractShardDataTreeTransaction, eliminating surface where
inconsistencies may be introduced.

Change-Id: If05f1bf2e76434d07feab115239addbb4b4bfb91
Signed-off-by: Robert Varga <rovarga@cisco.com>
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/ShardReadTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardReadWriteTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardSnapshotCohort.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardWriteTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/identifiers/ShardTransactionIdentifier.java [deleted file]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFailureTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionTest.java