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%2FShardDataTree.java;h=bf3b200825bc0c07c2283e7ceaf5d0c25363561a;hp=72ca1aebd8e1723a2a0c86de0ed2a9e7d250d544;hb=4f1f2ae598588f6aa5aac59b2206d97ad402a193;hpb=4bbbd57c8f96e864d4353c1bdbce0dc068a6a57b;ds=sidebyside diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java index 72ca1aebd8..bf3b200825 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java @@ -208,7 +208,10 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { final DataTreeModification unwrapped = unwrap(mod); dataTree.validate(unwrapped); - dataTree.commit(dataTree.prepare(unwrapped)); + DataTreeCandidateTip candidate = dataTree.prepare(unwrapped); + dataTree.commit(candidate); + notifyListeners(candidate); + LOG.debug("{}: state snapshot applied in %s", logContext, elapsed); } @@ -283,7 +286,7 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { } else if (payload instanceof DataTreeCandidatePayload) { applyRecoveryCandidate(((DataTreeCandidatePayload) payload).getCandidate()); } else { - LOG.warn("{}: ignoring unhandled payload {}", logContext, payload); + LOG.debug("{}: ignoring unhandled payload {}", logContext, payload); } } @@ -388,6 +391,7 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { return ensureTransactionChain(txId.getHistoryId()).newReadWriteTransaction(txId); } + @VisibleForTesting public void notifyListeners(final DataTreeCandidate candidate) { treeChangeListenerPublisher.publishChanges(candidate, logContext); dataChangeListenerPublisher.publishChanges(candidate, logContext); @@ -474,10 +478,11 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { return dataTree.takeSnapshot().readNode(path); } - public DataTreeSnapshot takeSnapshot() { + DataTreeSnapshot takeSnapshot() { return dataTree.takeSnapshot(); } + @VisibleForTesting public DataTreeModification newModification() { return dataTree.takeSnapshot().newModification(); }