Bug 8497 - Provide config knob to disable the Forwarding Rule Manager reconciliation
[openflowplugin.git] / applications / forwardingrules-manager / src / main / java / org / opendaylight / openflowplugin / applications / frm / impl / FlowNodeReconciliationImpl.java
index 52522f7230330072bc05c64a7fa850b4a822eafc..c530713c59c3ca7ddfbafcfb19acd8502930c708 100644 (file)
@@ -106,8 +106,14 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
 
     @Override
     public void reconcileConfiguration(InstanceIdentifier<FlowCapableNode> connectedNode) {
+        if (provider.isReconciliationDisabled()) {
+            LOG.debug("Reconciliation is disabled by user. Skipping reconciliation of node : {}", connectedNode
+                    .firstKeyOf(Node.class));
+            return;
+        }
         if (provider.isNodeOwner(connectedNode)) {
-            if (provider.getConfiguration().isStaleMarkingEnabled()) {
+            LOG.info("Triggering reconciliation for device {}", connectedNode.firstKeyOf(Node.class));
+            if (provider.isStaleMarkingEnabled()) {
                 LOG.info("Stale-Marking is ENABLED and proceeding with deletion of stale-marked entities on switch {}",
                         connectedNode.toString());
                 reconciliationPreProcess(connectedNode);
@@ -164,7 +170,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
                 Map<Long, ListenableFuture<?>> groupFutures = new HashMap<>();
 
                 while ((!(toBeInstalledGroups.isEmpty()) || !(suspectedGroups.isEmpty())) &&
-                        (counter <= provider.getConfiguration().getReconciliationRetryCount())) { //also check if the counter has not crossed the threshold
+                        (counter <= provider.getReconciliationRetryCount())) { //also check if the counter has not crossed the threshold
 
                     if (toBeInstalledGroups.isEmpty() && !suspectedGroups.isEmpty()) {
                         LOG.error("These Groups are pointing to node-connectors that are not up yet {}", suspectedGroups.toString());
@@ -249,7 +255,7 @@ public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
                 if (!toBeInstalledGroups.isEmpty()) {
                     for (Group group : toBeInstalledGroups) {
                         LOG.error("Installing the group {} finally although the port is not up after checking for {} times "
-                                , group.getGroupId().toString(), provider.getConfiguration().getReconciliationRetryCount());
+                                , group.getGroupId().toString(), provider.getReconciliationRetryCount());
                         addGroup(groupFutures, group);
                     }
                 }