Adds a new cfg file to configure table columns to be skipped when monitoring updates from OVS
switch. Currently following tables and columns are configurable:
1. Manager: status
Change-Id: I6d869ca559cb69374dcdf75b60282c105af85806
Signed-off-by: Vishal Thapar <vishal.thapar@ericsson.com>
<artifactId>southbound-impl</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>southbound-impl</artifactId>
+ <version>${project.version}</version>
+ <type>cfg</type>
+ <classifier>config</classifier>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>southbound-api</artifactId>
<feature version="${project.version}">odl-ovsdb-southbound-impl</feature>
<bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/{{VERSION}}</bundle>
+ <configfile finalname="etc/org.opendaylight.ovsdb.southbound.cfg">mvn:org.opendaylight.ovsdb/southbound-impl/{{VERSION}}/cfg/config</configfile>
</feature>
</features>
</properties>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${project.build.directory}/classes/initial/southbound.cfg</file>
+ <type>cfg</type>
+ <classifier>config</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
public class OvsdbConnectionInstance {
private static final Logger LOG = LoggerFactory.getLogger(OvsdbConnectionInstance.class);
- private OvsdbClient client;
+ private final OvsdbClient client;
private ConnectionInfo connectionInfo;
- private TransactionInvoker txInvoker;
+ private final TransactionInvoker txInvoker;
private Map<DatabaseSchema,TransactInvoker> transactInvokers;
private MonitorCallBack callback;
private InstanceIdentifier<Node> instanceIdentifier;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
//Note: _version is an internal column of ovsdb schema, that gets updated
//with every change in the row of the table.
+ // The "Manager" entry needs to be a modifiable list, SouthboundProvider::setSkipManagerStatus() modifies it
static final ImmutableMap<String,List<String>> SKIP_COLUMN_FROM_TABLE
= new ImmutableMap.Builder<String,List<String>>()
.put("Open_vSwitch", Arrays.asList("statistics","_version"))
.put("Port", Arrays.asList("statistics","_version"))
- .put("Manager", Collections.singletonList("_version"))
+ .put("Manager", new ArrayList<>(Collections.singletonList("_version")))
.put("SSL", Collections.singletonList("_version"))
.put("QoS", Collections.singletonList("_version"))
.put("Queue", Collections.singletonList("_version"))
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
+import java.util.Map;
import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
private OvsdbConnectionManager cm;
private TransactionInvoker txInvoker;
private OvsdbDataTreeChangeListener ovsdbDataTreeChangeListener;
- private EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipService entityOwnershipService;
private EntityOwnershipCandidateRegistration registration;
private SouthboundPluginInstanceEntityOwnershipListener providerOwnershipChangeListener;
- private OvsdbConnection ovsdbConnection;
+ private final OvsdbConnection ovsdbConnection;
private final InstanceIdentifierCodec instanceIdentifierCodec;
+ private static final String SKIP_MONITORING_MANAGER_STATUS_PARAM = "skip-monitoring-manager-status";
public SouthboundProvider(final DataBroker dataBroker,
final EntityOwnershipService entityOwnershipServiceDependency,
}
private class SouthboundPluginInstanceEntityOwnershipListener implements EntityOwnershipListener {
- private SouthboundProvider sp;
- private EntityOwnershipListenerRegistration listenerRegistration;
+ private final SouthboundProvider sp;
+ private final EntityOwnershipListenerRegistration listenerRegistration;
SouthboundPluginInstanceEntityOwnershipListener(SouthboundProvider sp,
EntityOwnershipService entityOwnershipService) {
}
}
+ public void updateConfigParameter(Map<String, Object> configParameters) {
+ if (configParameters != null && !configParameters.isEmpty()) {
+ LOG.debug("Config parameters received : {}", configParameters.entrySet());
+ for (Map.Entry<String, Object> paramEntry : configParameters.entrySet()) {
+ if (paramEntry.getKey().equalsIgnoreCase(SKIP_MONITORING_MANAGER_STATUS_PARAM)) {
+ setSkipMonitoringManagerStatus(Boolean.parseBoolean((String)paramEntry.getValue()));
+ break;
+ }
+ }
+ }
+ }
+
+ public void setSkipMonitoringManagerStatus(boolean flag) {
+ LOG.debug("skipManagerStatus set to {}", flag);
+ if (flag) {
+ SouthboundConstants.SKIP_COLUMN_FROM_TABLE.get("Manager").add("status");
+ } else {
+ SouthboundConstants.SKIP_COLUMN_FROM_TABLE.get("Manager").remove("status");
+ }
+ }
}
--- /dev/null
+######################################################
+# Performance Tuning Configuration Parameters #
+######################################################
+# Setting "skip-monitoring-manager-status" value to "true" will skip
+# monitoring of "status" column of OVSDB database "Manager"
+# table of OVS switch. By default monitoring of the column is #enabled (default value "false").
+# NOTE: Setting it to true will reduce the number of updates
+# received by OVSDB plugin from OVS, that eventually help in
+# improving the performance of OVSDB southbound plugin.
+# However, it will impact functionality in a clustered HA
+# setup. So please use this option when you are running OVSDB
+# southbound plugin in single node and want to achieve better
+# performance.
+#skip-monitoring-manager-status = false
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
odl:use-default-for-reference-types="true">
<reference id="dataBroker"
<reference id="bindingNormalizedNodeSerializer"
interface="org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer" />
+ <cm:property-placeholder persistent-id="org.opendaylight.ovsdb.southbound" update-strategy="none">
+ <cm:default-properties>
+ <cm:property name="skip-monitoring-manager-status" value="false"/>
+ </cm:default-properties>
+ </cm:property-placeholder>
+
<bean id="southboundProvider"
class="org.opendaylight.ovsdb.southbound.SouthboundProvider"
init-method="init" destroy-method="close">
+ <cm:managed-properties persistent-id="org.opendaylight.ovsdb.southbound"
+ update-strategy="component-managed"
+ update-method="updateConfigParameter"/>
<argument ref="dataBroker" />
<argument ref="eos" />
<argument ref="ovsdbConnection" />
<argument ref="schemaService" />
<argument ref="bindingNormalizedNodeSerializer" />
+ <property name="skipMonitoringManagerStatus" value="${skip-monitoring-manager-status}"/>
</bean>
</blueprint>