X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Ftopologymanager%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Ftopologymanager%2Finternal%2FTopologyManagerImpl.java;h=ff1c026a344d74efa5aa1f1b57e05e60775cd1a4;hp=cc1a8b868d3d376c9eb4a66b5443707adbfbff31;hb=d9de6c2ddfb30eb2eee782c229f6e03cef352bbd;hpb=619f87d7ff5b11898aa1571d5fad7c9468753ecd diff --git a/opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImpl.java b/opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImpl.java index cc1a8b868d..ff1c026a34 100644 --- a/opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImpl.java +++ b/opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImpl.java @@ -573,6 +573,13 @@ public class TopologyManagerImpl implements switch (type) { case ADDED: + + if (this.edgesDB.containsKey(e)) { + // Avoid redundant updates (e.g. cluster switch-over) as notifications trigger expensive tasks + log.trace("Skipping redundant edge addition: {}", e); + return null; + } + // Make sure the props are non-null or create a copy if (props == null) { props = new HashSet(); @@ -580,19 +587,6 @@ public class TopologyManagerImpl implements props = new HashSet(props); } - Set currentProps = this.edgesDB.get(e); - if (currentProps != null) { - - if (currentProps.equals(props)) { - // Avoid redundant updates as notifications trigger expensive tasks - log.trace("Skipping redundant edge addition: {}", e); - return null; - } - - // In case of node switch-over to a different cluster controller, - // let's retain edge props (e.g. creation time) - props.addAll(currentProps); - } // Ensure that head node connector exists if (!headNodeConnectorExist(e)) { @@ -654,10 +648,9 @@ public class TopologyManagerImpl implements case CHANGED: Set oldProps = this.edgesDB.get(e); - // When property changes lets make sure we can change it + // When property(s) changes lets make sure we can change it // all except the creation time stamp because that should - // be changed only when the edge is destroyed and created - // again + // be set only when the edge is created TimeStamp timeStamp = null; for (Property prop : oldProps) { if (prop instanceof TimeStamp) {