BUG-9054: do not use BatchedModifications needlessly 24/62524/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 30 Aug 2017 14:28:28 +0000 (16:28 +0200)
committerRobert Varga <nite@hq.sk>
Fri, 1 Sep 2017 07:38:41 +0000 (07:38 +0000)
commit88a6b2f0a11ac2318795b0e9124ac596a386304a
tree5d4bdd2bd22ab70a3e2e7e4a386e44574b1ac738
parent0077859d16ed922af1449f075033069f4d9dbffe
BUG-9054: do not use BatchedModifications needlessly

Transaction identifier, which is a required parameter for
BatchedModifications is a resource tracked on the backend and is
assumed to be allocated contiguously. Using BatchedModifications
to transport only a list of modifications means we are allocating
transactions IDs which we then never use.

This patch reworks the logic so it tracks modifications in a list
and allocates BatchedModifications only when we are ready to actually
commit something.

Change-Id: I3f71511cfd68e96e80790e69d28d083f195e5e12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 71a4b6377ba598b18c64b89b6b16538751d2d116)
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShard.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardCommitCoordinator.java