X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Futils%2FNormalizedNodeAggregator.java;h=efb14971bb309ad30eac877160461b12e848d99e;hp=a406b9aaf5707c305b497f49096509a44f23c188;hb=132578158b5b621b6ff372219fdfd4f8c5728885;hpb=bd4f0b8a037ce953cd3c6aad5abc7d2c7be01c69 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregator.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregator.java index a406b9aaf5..efb14971bb 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregator.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/NormalizedNodeAggregator.java @@ -23,8 +23,8 @@ public class NormalizedNodeAggregator { private final List>> nodes; private final DataTree dataTree; - private NormalizedNodeAggregator(YangInstanceIdentifier rootIdentifier, List>> nodes, - SchemaContext schemaContext) { + private NormalizedNodeAggregator(final YangInstanceIdentifier rootIdentifier, final List>> nodes, + final SchemaContext schemaContext) { this.rootIdentifier = rootIdentifier; this.nodes = nodes; this.dataTree = InMemoryDataTreeFactory.getInstance().create(); @@ -39,9 +39,9 @@ public class NormalizedNodeAggregator { * @return * @throws DataValidationFailedException */ - public static Optional> aggregate(YangInstanceIdentifier rootIdentifier, - List>> nodes, - SchemaContext schemaContext) throws DataValidationFailedException { + public static Optional> aggregate(final YangInstanceIdentifier rootIdentifier, + final List>> nodes, + final SchemaContext schemaContext) throws DataValidationFailedException { return new NormalizedNodeAggregator(rootIdentifier, nodes, schemaContext).aggregate(); } @@ -50,14 +50,14 @@ public class NormalizedNodeAggregator { } private NormalizedNodeAggregator combine() throws DataValidationFailedException { - DataTreeModification mod = dataTree.takeSnapshot().newModification(); + final DataTreeModification mod = dataTree.takeSnapshot().newModification(); - for (Optional> node : nodes) { + for (final Optional> node : nodes) { if (node.isPresent()) { mod.merge(rootIdentifier, node.get()); } } - + mod.ready(); dataTree.validate(mod); final DataTreeCandidate candidate = dataTree.prepare(mod); dataTree.commit(candidate);