X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FMutableDataTree.java;h=1002cd54b51b9afab310ec0e28d949c2fb2584a5;hp=b711163b465d3ca07914da3d3472347ab854533e;hb=3f10df4865b301abdeff3d916c0eff22156a6eac;hpb=84248dac9ed8aa37e996e39429c8aa8ece473eaf diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/MutableDataTree.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/MutableDataTree.java index b711163b46..1002cd54b5 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/MutableDataTree.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/MutableDataTree.java @@ -34,13 +34,13 @@ class MutableDataTree { private static final Logger LOG = LoggerFactory.getLogger(MutableDataTree.class); private final AtomicBoolean sealed = new AtomicBoolean(); private final ModificationApplyOperation strategyTree; - private final DataAndMetadataSnapshot snapshot; private final NodeModification rootModification; + private final DataTree.Snapshot snapshot; - private MutableDataTree(final DataAndMetadataSnapshot snapshot, final ModificationApplyOperation strategyTree) { - this.snapshot = snapshot; - this.strategyTree = strategyTree; - this.rootModification = NodeModification.createUnmodified(snapshot.getMetadataTree()); + private MutableDataTree(final DataTree.Snapshot snapshot, final ModificationApplyOperation strategyTree) { + this.snapshot = Preconditions.checkNotNull(snapshot); + this.strategyTree = Preconditions.checkNotNull(strategyTree); + this.rootModification = NodeModification.createUnmodified(snapshot.getRootNode()); } public void write(final InstanceIdentifier path, final NormalizedNode value) { @@ -97,7 +97,7 @@ class MutableDataTree { return potentialSnapshot.get(); } return resolveModificationStrategy(path).apply(modification, modification.getOriginal(), - StoreUtils.increase(snapshot.getMetadataTree().getSubtreeVersion())); + StoreUtils.increase(snapshot.getRootNode().getSubtreeVersion())); } catch (Exception e) { LOG.error("Could not create snapshot for {}:{}", path,modification,e); throw e; @@ -119,7 +119,7 @@ class MutableDataTree { return OperationWithModification.from(operation, modification); } - public static MutableDataTree from(final DataAndMetadataSnapshot snapshot, final ModificationApplyOperation resolver) { + public static MutableDataTree from(final DataTree.Snapshot snapshot, final ModificationApplyOperation resolver) { return new MutableDataTree(snapshot, resolver); }