ForwardingRulesCommiter<TableFeatures> getTableFeaturesCommiter();
/**
- * Returns the config-subsystem/fallback configuration of FRM
- * @return ForwardingRulesManagerConfig
+ * Check if reconciliation is disabled by user.
+ * @return true if reconciliation is disabled, else false
*/
- ForwardingRulesManagerConfig getConfiguration();
+ boolean isReconciliationDisabled();
+
+ /**
+ * Check if stale marking is enabled for switch reconciliation.
+ * @return true if stale marking is enabled, else false
+ */
+ boolean isStaleMarkingEnabled();
+
+ /**
+ * Return number of reconciliation retry are allowed.
+ * @return number of retries.
+ */
+ int getReconciliationRetryCount();
/**
* Method checks if *this* instance of openflowplugin is owner of
}
}
else{
- if (provider.getConfiguration().isStaleMarkingEnabled()) {
+ if (provider.isStaleMarkingEnabled()) {
LOG.info("Stale-Marking ENABLED and switch {} is NOT connected, storing stale entities",
nodeIdent.toString());
// Switch is NOT connected
public void setDeviceOperationalStatus(boolean inOperDS) {
isDeviceInOperDS.set(inOperDS);
if(canReconcile()) {
- LOG.info("Triggering reconciliation for device {}", nodeId.getValue());
reconcliationAgent.reconcileConfiguration(fcnIID);
}
}
@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);
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());
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);
}
}
import com.google.common.util.concurrent.CheckedFuture;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicLong;
+import javax.annotation.Nonnull;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
private final ForwardingRulesManagerConfig forwardingRulesManagerConfig;
private final ClusterSingletonServiceProvider clusterSingletonServiceProvider;
private final NotificationProviderService notificationService;
+ private final boolean disableReconciliation;
+ private final boolean staleMarkingEnabled;
+ private final int reconciliationRetryCount;
private ForwardingRulesCommiter<Flow> flowListener;
private ForwardingRulesCommiter<Group> groupListener;
final RpcConsumerRegistry rpcRegistry,
final ForwardingRulesManagerConfig config,
final ClusterSingletonServiceProvider clusterSingletonService,
- final NotificationProviderService notificationService) {
+ final NotificationProviderService notificationService,
+ final boolean disableReconciliation,
+ final boolean staleMarkingEnabled,
+ final int reconciliationRetryCount) {
this.dataService = Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!");
this.forwardingRulesManagerConfig = Preconditions.checkNotNull(config, "Configuration for FRM cannot be null");
this.clusterSingletonServiceProvider = Preconditions.checkNotNull(clusterSingletonService,
"RPC SalMeterService not found.");
this.salTableService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalTableService.class),
"RPC SalTableService not found.");
+
+ this.disableReconciliation = disableReconciliation;
+ this.staleMarkingEnabled = staleMarkingEnabled;
+ this.reconciliationRetryCount = reconciliationRetryCount;
}
@Override
}
@Override
- public ForwardingRulesManagerConfig getConfiguration() {
- return forwardingRulesManagerConfig;
+ public boolean isReconciliationDisabled() {
+ return this.disableReconciliation;
+ }
+
+ @Override
+ public boolean isStaleMarkingEnabled() {
+ return this.staleMarkingEnabled;
+ }
+
+ @Override
+ public int getReconciliationRetryCount() {
+ return this.reconciliationRetryCount;
}
@Override
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
odl:use-default-for-reference-types="true">
<odl:clustered-app-config id="frmConfig"
binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.forwardingrules.manager.config.rev160511.ForwardingRulesManagerConfig"/>
+ <cm:property-placeholder persistent-id="org.opendaylight.openflowplugin"
+ placeholder-prefix="${frm-"
+ update-strategy="none">
+ <cm:default-properties>
+ <!-- Disable switch reconciliation -->
+ <cm:property name="disable-reconciliation" value="false"/>
+ <!-- Enable stale marking for switch reconciliation -->
+ <cm:property name="stale-marking-enabled" value="false"/>
+ <!-- Number of retries for switch reconciliation -->
+ <cm:property name="reconciliation-retry-count" value="5"/>
+ </cm:default-properties>
+ </cm:property-placeholder>
+
<bean id="frmManager" class="org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerImpl"
init-method="start" destroy-method="close">
<argument ref="dataBroker"/>
<argument ref="frmConfig"/>
<argument ref="clusterSingletonService"/>
<argument ref="notificationService"/>
+ <argument value="${frm-disable-reconciliation}"/>
+ <argument value="${frm-stale-marking-enabled}"/>
+ <argument value="${frm-reconciliation-retry-count}"/>
+
</bean>
</blueprint>
\ No newline at end of file
rpcProviderRegistryMock,
getConfig(),
clusterSingletonService,
- notificationService);
+ notificationService, false, false, 5);
forwardingRulesManager.start();
// TODO consider tests rewrite (added because of complicated access)
forwardingRulesManager.setDeviceMastershipManager(deviceMastershipManager);
rpcProviderRegistryMock,
getConfig(),
clusterSingletonService,
- notificationService);
+ notificationService, false, false, 5);
forwardingRulesManager.start();
// TODO consider tests rewrite (added because of complicated access)
forwardingRulesManager.setDeviceMastershipManager(deviceMastershipManager);
rpcProviderRegistryMock,
getConfig(),
clusterSingletonService,
- notificationService);
+ notificationService, false, false, 5);
forwardingRulesManager.start();
// TODO consider tests rewrite (added because of complicated access)
forwardingRulesManager.setDeviceMastershipManager(deviceMastershipManager);
rpcProviderRegistryMock,
getConfig(),
clusterSingletonService,
- notificationService);
+ notificationService, false ,false ,5);
forwardingRulesManager.start();
}
rpcProviderRegistryMock,
getConfig(),
clusterSingletonService,
- notificationService);
+ notificationService, false, false , 5);
forwardingRulesManager.start();
// TODO consider tests rewrite (added because of complicated access)
forwardingRulesManager.setDeviceMastershipManager(deviceMastershipManager);
# then to format supported by device, and reversed when deserializing.
#
# use-single-layer-serialization=true
+
+#############################################################################
+# #
+# Forwarding Rule Manager Application Configuration #
+# #
+#############################################################################
+
+# Disable the default switch reconciliation mechanism
+# disable-reconciliation=false
+
+# Enable stale marking for switch reconciliation. Once user enable this feature
+# forwarding rule manager will keep track of any change to the config data store
+# while the switch is disconnected from controller. Once switch reconnect to the
+# controller it will apply those changes to the switch and do the reconciliation
+# of other configuration as well.
+# NOTE: This option will be effective only if disable_reconciliation=false.
+# stale-marking-enabled=false
+
+# Number of time forwarding rules manager should retry to reconcile any specific
+# configuration.
+# reconciliation-retry-count=5
modifiable = false;
break;
default:
- LOG.warn("Unsupported configuration property '{}={}'", key, sValue);
return;
}