Bug 5153: Add timestamp to TransactionIdentifier 14/34514/1
authorTom Pantelis <tpanteli@brocade.com>
Wed, 3 Feb 2016 06:43:38 +0000 (01:43 -0500)
committerTom Pantelis <tpanteli@brocade.com>
Thu, 11 Feb 2016 22:19:42 +0000 (22:19 +0000)
commit5d80babc178948bb31c844979ac7ed382cbf5965
treee11c6286825af1acb5d1e13e67b4db245cacaa2a
parentd9333b4630b36ac22aa7ef26b7028677dbb316fd
Bug 5153: Add timestamp to TransactionIdentifier

TransactionIdentifiers are created locally but sent to the remote leader
so it's possible, after a restart, for the remote leader to see the same id
for 2 different txns since the local counter starts at 1. To alleviate
this I added a timestamp to TransactionIdentifier. I could've just used
a UUID but the counter is useful for debugging and a full UUID would
make the string version pretty long for logging. I think an additional
millisec timestamp is sufficient.

Change-Id: Iaabd3d25eb64dd14053f96336c48de90d4364678
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit 74fc38503a3565bed6218f65ab8f4425c61460a3)
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/identifiers/ChainedTransactionIdentifier.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/identifiers/TransactionIdentifier.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/identifiers/ChainedTransactionIdentifierTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/identifiers/TransactionChainIdentifierTest.java