DEFAULT will be ON, can be TURNED OFF.
Change-Id: I16403590f068cd53806c15acde6e6ccbb3ade866
Signed-off-by: Shuva Kar <shuva.jyoti.kar@ericsson.com>
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
<name>binding-notification-broker</name>
</notification-service>
- <ownership-service>
- <type xmlns:entity-ownership="urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:entity-ownership-service">entity-ownership:entity-ownership-service</type>
- <name>entity-ownership-service</name>
- </ownership-service>
-
+ <ownership-service>
+ <type xmlns:entity-ownership="urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:entity-ownership-service">entity-ownership:entity-ownership-service</type>
+ <name>entity-ownership-service</name>
+ </ownership-service>
+
+ <!-- openflowplugin configuraion -->
+ <skip-table-features>false</skip-table-features>
</module>
</modules>
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.openflowplugin.api.openflow.md.ModelDrivenSwitch;
import org.opendaylight.openflowplugin.api.openflow.md.core.NotificationQueueWrapper;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.OpenflowPluginConfig;
import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.FutureCallback;
-import java.util.concurrent.ArrayBlockingQueue;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.CheckedFuture;
import org.slf4j.Logger;
private final ListeningExecutorService pool;
- public OfEntityManager( EntityOwnershipService entityOwnershipService ) {
+ private final OpenflowPluginConfig openflowPluginConfig;
+
+ public OfEntityManager(EntityOwnershipService entityOwnershipService, OpenflowPluginConfig ofPluginConfig) {
this.entityOwnershipService = entityOwnershipService;
+ openflowPluginConfig = ofPluginConfig;
ownershipListener = new OpenflowOwnershipListener(this);
entsession = new ConcurrentHashMap<>();
entRegistrationMap = new ConcurrentHashMap<>();
final String targetSwitchDPId = sessionContext.getFeatures().getDatapathId().toString();
RolePushTask task = new RolePushTask(newRole, sessionContext);
ListenableFuture<Boolean> rolePushResult = pool.submit(task);
+
final CheckedFuture<Boolean, RolePushException> rolePushResultChecked =
RoleUtil.makeCheckedRuleRequestFxResult(rolePushResult);
Futures.addCallback(rolePushResult, new FutureCallback<Boolean>(){
public void onSuccess(Boolean result){
LOG.info("onDeviceOwnershipChanged: Controller is successfully set as a " +
"MASTER controller for {}", targetSwitchDPId);
- entsession.get(entity).getOfSwitch().sendEmptyTableFeatureRequest();
+ if(!openflowPluginConfig.skipTableFeatures()) {
+ if(LOG.isDebugEnabled()){
+ LOG.debug("Send table feature request for entity {}",entity.getId());
+ }
+ entsession.get(entity).getOfSwitch().sendEmptyTableFeatureRequest();
+ }
sendNodeAddedNotification(entsession.get(entity));
}
--- /dev/null
+/*
+ * Copyright (c) 2016 Ericsson Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.openflow.md.core.sal;
+
+/**
+ * Created by eshuvka on 5/16/2016.
+ */
+public class OpenflowPluginConfig {
+
+ private final boolean skipTableFeatures;
+
+ private OpenflowPluginConfig (OpenflowPluginConfigBuilder builder){
+ skipTableFeatures = builder.skipTableFeatures();
+ }
+
+ public boolean skipTableFeatures(){
+ return skipTableFeatures;
+ }
+
+ public static OpenflowPluginConfigBuilder builder(){
+ return new OpenflowPluginConfigBuilder();
+ }
+
+ public static class OpenflowPluginConfigBuilder{
+ private boolean skipTableFeatures;
+
+ public boolean skipTableFeatures(){
+ return skipTableFeatures;
+ }
+
+ public void setSkipTableFeatures(boolean skip){
+ skipTableFeatures = skip;
+ }
+
+ public OpenflowPluginConfig build() {return new OpenflowPluginConfig(this);}
+ }
+}
private RpcProviderRegistry rpcRegistry;
private EntityOwnershipService entityOwnershipService;
+ private OpenflowPluginConfig openflowPluginConfig;
+
/**
* Initialization of services and msgSpy counter
*/
messageCountProvider = new MessageSpyCounterImpl();
extensionConverterManager = new ExtensionConverterManagerImpl();
roleManager = new OFRoleManager(OFSessionUtil.getSessionManager());
- entManager = new OfEntityManager(entityOwnershipService);
+ entManager = new OfEntityManager(entityOwnershipService,getOpenflowPluginConfig());
entManager.setDataBroker(dataBroker);
LOG.debug("dependencies gathered..");
this.entityOwnershipService = entityOwnershipService;
}
+ public void setOpenflowPluginConfig(OpenflowPluginConfig openflowPluginConfig) {
+ this.openflowPluginConfig = openflowPluginConfig;
+ }
+
+ @VisibleForTesting
+ public OpenflowPluginConfig getOpenflowPluginConfig() {
+ return openflowPluginConfig;
+ }
+
@VisibleForTesting
protected RpcProviderRegistry getRpcRegistry() {
return rpcRegistry;
import com.google.common.base.MoreObjects;
import javax.management.ObjectName;
+
+import org.opendaylight.openflowplugin.openflow.md.core.sal.OpenflowPluginConfig;
import org.opendaylight.openflowplugin.openflow.md.core.sal.OpenflowPluginProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
*/
public final class ConfigurableOpenFlowProviderModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.common.config.impl.rev140326.AbstractConfigurableOpenFlowProviderModule {
+ private static final Logger LOG = LoggerFactory.getLogger(ConfigurableOpenFlowProviderModule.class);
+
private OpenflowPluginProvider pluginProvider;
+ private static final boolean SKIP_TABLE_FEATURES = false;
+
/**
* @param identifier module identifier
* @param dependencyResolver dependency resolver
pluginProvider.setSwitchConnectionProviders(getOpenflowSwitchConnectionProviderDependency());
pluginProvider.setEntityOwnershipService(getOwnershipServiceDependency());
pluginProvider.setRole(getRole());
+ pluginProvider.setOpenflowPluginConfig(readConfig());
pluginProvider.initialization();
return pluginProvider;
}
return recycled;
}
+
+ private OpenflowPluginConfig readConfig(){
+
+ final OpenflowPluginConfig.OpenflowPluginConfigBuilder openflowCfgBuilder = OpenflowPluginConfig.builder();
+
+ if(getSkipTableFeatures()!=null){
+ openflowCfgBuilder.setSkipTableFeatures(getSkipTableFeatures().booleanValue());
+ } else{
+ LOG.warn("Could not load XML configuration file via ConfigSubsystem! Fallback to default config value(s)");
+ openflowCfgBuilder.setSkipTableFeatures(SKIP_TABLE_FEATURES);
+ }
+
+ return openflowCfgBuilder.build();
+ }
}
type ofp-role;
default "NOCHANGE";
}
+
+ leaf skip-table-features {
+ description "Ability to skip pulling and storing of large table features. These features are still
+ available via rpc, so if use set it to true, it won't store table feature data in DataStore.";
+ type boolean;
+ default "false";
+ }
}
case msg-spy-service-impl {
private ModelDrivenSwitch mdSwitchOF13;
-
CompositeObjectRegistration<ModelDrivenSwitch> registration;
context.setFeatures(features);
context.setNotificationEnqueuer(notificationEnqueuer);
- OfEntityManager entManager = new OfEntityManager(entityOwnershipService);
+ OfEntityManager entManager = new OfEntityManager(entityOwnershipService,getConfig());
mdSwitchOF13 = new ModelDrivenSwitchImpl(null, null, context);
registration = new CompositeObjectRegistration<>(mdSwitchOF13, Collections.<Registration>emptyList());
context.setProviderRegistration(registration);
SwitchSessionKeyOF switchSessionKeyOF = new SwitchSessionKeyOF();
salRegistrationManager.onSessionAdded(switchSessionKeyOF, context);
}
+
+ public OpenflowPluginConfig getConfig(){
+ OpenflowPluginConfig.OpenflowPluginConfigBuilder cfgBuilder =
+ new OpenflowPluginConfig.OpenflowPluginConfigBuilder();
+ cfgBuilder.setSkipTableFeatures(true);
+ return cfgBuilder.build();
+
+ }
}