BUG 2970 : Create a PruningDataTreeModification 84/21384/2
authorMoiz Raja <moraja@cisco.com>
Sat, 23 May 2015 00:22:02 +0000 (17:22 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 29 May 2015 06:07:11 +0000 (06:07 +0000)
commit085b076786d299c235ab5561c9fa678fd6b8d726
tree6cfbea6c460fcc752fddf4bda4d9d018e844498a
parent6da2893d4a3a939a1f5d4079f6ffe04a305754e6
BUG 2970 : Create a PruningDataTreeModification

The PruningDataTreeModification automatically tries to prune the passed
in NormalizedNode if an IllegalArgumentException is thrown when doing
a write or a merge on the DataTreeModification.

*I know* that doing the pruning on IllegalArgumentException is flaky but
that is the best I can do unless we can change the implementation in yangtools
to throw a more specific exception when the data node does not map to a
the schema context

Change-Id: Iea0cea82eda8bd51c1f3f07b063404458798c348
Signed-off-by: Moiz Raja <moraja@cisco.com>
(cherry picked from commit 759e3c83955458b56d5d3e5a64521e0662b41004)
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/transformer/NormalizedNodePruner.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/ShardDataTree.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeSnapshot.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/SimpleShardDataTreeCohort.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModification.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeSnapshotTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModificationTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/md/cluster/datastore/model/SchemaContextHelper.java