Merge "Gerrit contains following minor enhancements: 1) Send statistics requests...
authorEd Warnicke <eaw@cisco.com>
Sat, 25 Jan 2014 05:59:32 +0000 (05:59 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Sat, 25 Jan 2014 05:59:32 +0000 (05:59 +0000)
opendaylight/config/config-plugin-parent/pom.xml
opendaylight/config/pom.xml
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java
opendaylight/netconf/pom.xml
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java

index 0117098ee1491b66b4011bfd62f669792c7bd29b..b8f8d9822bf8bce5bcb5bc77d6f35fc2f8874364 100644 (file)
@@ -16,6 +16,7 @@
 
     <properties>
         <jmxGeneratorPath>${project.build.directory}/generated-sources/config</jmxGeneratorPath>
+        <config.version>0.2.3-SNAPSHOT</config.version>
     </properties>
 
     <build>
index ad6ac31860f07750f4a857d7a24db602dd46edc5..9eede7765b47e7db1ce4220c0af3d0ae99cd8fc4 100644 (file)
@@ -69,6 +69,7 @@
         <jacoco.version>0.6.2.201302030002</jacoco.version>
         <slf4j.version>1.7.2</slf4j.version>
         <salGeneratorPath>${project.build.directory}/generated-sources/sal</salGeneratorPath>
+        <config.version>0.2.3-SNAPSHOT</config.version>
     </properties>
 
     <dependencies>
index fc5aac031133facd0e6e0aa18a62db3d0414fa0d..9c002206879f1a8cff46a9d1df2bf6c6a9685185 100644 (file)
@@ -2064,6 +2064,22 @@ public class ForwardingRulesManager implements
     public void subnetNotify(Subnet sub, boolean add) {
     }
 
+    private boolean programInternalFlow(boolean proactive, FlowConfig fc) {
+        boolean retVal = true; // program flows unless determined otherwise
+        if(proactive) {
+            // if the flow already exists do not program
+            if(flowConfigExists(fc)) {
+                retVal = false;
+            }
+        } else {
+            // if the flow does not exist do not program
+            if(!flowConfigExists(fc)) {
+                retVal = false;
+            }
+        }
+        return retVal;
+    }
+
     /**
      * (non-Javadoc)
      *
@@ -2120,12 +2136,18 @@ public class ForwardingRulesManager implements
 
                 log.trace("Forwarding mode for node {} set to {}", node, (proactive ? "proactive" : "reactive"));
                 for (FlowConfig fc : defaultConfigs) {
-                    Status status = (proactive) ? addStaticFlowInternal(fc, false) : removeStaticFlow(fc);
-                    if (status.isSuccess()) {
-                        log.trace("{} Proactive Static flow: {}", (proactive ? "Installed" : "Removed"), fc.getName());
+                    // check if the frm really needs to act on the notification.
+                    // this is to check against duplicate notifications
+                    if(programInternalFlow(proactive, fc)) {
+                        Status status = (proactive) ? addStaticFlowInternal(fc, false) : removeStaticFlow(fc);
+                        if (status.isSuccess()) {
+                            log.trace("{} Proactive Static flow: {}", (proactive ? "Installed" : "Removed"), fc.getName());
+                        } else {
+                            log.warn("Failed to {} Proactive Static flow: {}", (proactive ? "install" : "remove"),
+                                    fc.getName());
+                        }
                     } else {
-                        log.warn("Failed to {} Proactive Static flow: {}", (proactive ? "install" : "remove"),
-                                fc.getName());
+                        log.debug("Got redundant install request for internal flow: {} on node: {}. Request not sent to FRM.", fc.getName(), node);
                     }
                 }
                 return new Status(StatusCode.SUCCESS);
index b70586f432b954fcc0ba1443cfcc73c253888708..b419df0bbe13e672674d67b31b6b7ed5340acc1b 100644 (file)
@@ -50,6 +50,8 @@
         <maven.bundle.version>2.4.0</maven.bundle.version>
         <slf4j.version>1.7.2</slf4j.version>
         <netconf.netty.version>4.0.10.Final</netconf.netty.version>
+        <netconf.version>0.2.3-SNAPSHOT</netconf.version>
+        <config.version>0.2.3-SNAPSHOT</config.version>
     </properties>
 
     <dependencies>
index 5b2687fb3b7e058a3f0bd18b0078c937fa6bd1a5..674da37afb5676a971905aefc3caf2a84eb2c761 100644 (file)
@@ -1103,8 +1103,7 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
 
     private void updateNode(Node node, Set<Property> props) {
         log.trace("{} updated, props: {}", node, props);
-        if (nodeProps == null || !nodeProps.containsKey(node) ||
-                props == null || props.isEmpty()) {
+        if (nodeProps == null || props == null) {
             return;
         }