Merge "Add missing exception to log message in SchemaAwareRpcBroker"
authorTony Tkacik <ttkacik@cisco.com>
Wed, 7 May 2014 16:46:08 +0000 (16:46 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 7 May 2014 16:46:08 +0000 (16:46 +0000)
opendaylight/config/feature/pom.xml [new file with mode: 0644]
opendaylight/config/feature/src/main/resources/features.xml [new file with mode: 0644]
opendaylight/config/pom.xml
opendaylight/distribution/opendaylight-karaf/pom.xml
opendaylight/md-sal/feature/pom.xml [new file with mode: 0644]
opendaylight/md-sal/feature/src/main/resources/features.xml [new file with mode: 0644]
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/SingletonHolder.java

diff --git a/opendaylight/config/feature/pom.xml b/opendaylight/config/feature/pom.xml
new file mode 100644 (file)
index 0000000..aaf33cc
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-subsystem</artifactId>
+    <version>0.2.5-SNAPSHOT</version>
+  </parent>
+  <artifactId>config-features</artifactId>
+
+  <packaging>pom</packaging>
+
+  <properties>
+    <features.file>features.xml</features.file>
+  </properties>
+
+  <dependencies></dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <filtering>true</filtering>
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>filter</id>
+            <goals>
+              <goal>resources</goal>
+            </goals>
+            <phase>generate-resources</phase>
+          </execution>
+        </executions>
+      </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/${features.file}</file>
+                  <type>xml</type>
+                  <classifier>features</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+  </scm>
+</project>
diff --git a/opendaylight/config/feature/src/main/resources/features.xml b/opendaylight/config/feature/src/main/resources/features.xml
new file mode 100644 (file)
index 0000000..81972c3
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<features name="config-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+    <feature name='config-all' version='${project.version}'>
+        <feature version='${project.version}'>odl-config-subsystem</feature>
+    </feature>
+
+    <feature name='odl-config-subsystem' version='${project.version}'>
+        <feature version='${yangtools.version}'>yangtools-concepts</feature>
+        <feature version='${yangtools.version}'>yangtools-binding</feature>
+        <feature version='${yangtools.version}'>yangtools-binding-generator</feature>
+        <feature version='${mdsal.version}'>odl-mdsal-commons</feature>
+        <bundle>mvn:org.opendaylight.controller/config-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/config-manager/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/yang-jmx-generator/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/config-persister-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/config-persister-file-xml-adapter/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/config-persister-directory-xml-adapter/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/shutdown-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/shutdown-impl/${project.version}</bundle>
+        <bundle>mvn:org.osgi/org.osgi.core/${osgi.core.version}</bundle>
+        <bundle>wrap:mvn:com.google.guava/guava/${guava.version}</bundle>
+        <bundle>mvn:org.javassist/javassist/${javassist.version}</bundle>
+    </feature>
+</features>
\ No newline at end of file
index 20b1b41..9e0aef3 100644 (file)
@@ -40,6 +40,7 @@
     <module>shutdown-impl</module>
     <module>netconf-config-dispatcher</module>
     <module>config-module-archetype</module>
+    <module>feature</module>
   </modules>
 
   <dependencies>
index 7708985..1414fac 100644 (file)
       <version>${karaf.version}</version>
       <type>kar</type>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>config-features</artifactId>
+      <version>${config.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
     <!-- scope is runtime so the feature repo is listed in the features
       service config file, and features may be installed using the
       karaf-maven-plugin configuration -->
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
+  -->
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>mdsal-features</artifactId>
+      <version>${mdsal.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>features-file</artifactId>
@@ -50,7 +67,6 @@
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
-  -->
   </dependencies>
 
   <build>
diff --git a/opendaylight/md-sal/feature/pom.xml b/opendaylight/md-sal/feature/pom.xml
new file mode 100644 (file)
index 0000000..c08c3e5
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>sal-parent</artifactId>
+    <version>1.1-SNAPSHOT</version>
+  </parent>
+  <artifactId>mdsal-features</artifactId>
+
+  <packaging>pom</packaging>
+
+  <properties>
+    <features.file>features.xml</features.file>
+  </properties>
+
+  <dependencies></dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <filtering>true</filtering>
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>filter</id>
+            <goals>
+              <goal>resources</goal>
+            </goals>
+            <phase>generate-resources</phase>
+          </execution>
+        </executions>
+      </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/${features.file}</file>
+                  <type>xml</type>
+                  <classifier>features</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+  </scm>
+</project>
diff --git a/opendaylight/md-sal/feature/src/main/resources/features.xml b/opendaylight/md-sal/feature/src/main/resources/features.xml
new file mode 100644 (file)
index 0000000..f816018
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<features name="mdsal-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+    <feature name='mdsal-all' version='${project.version}'>
+        <feature version='${project.version}'>odl-mdsal-commons</feature>
+        <feature version='${project.version}'>odl-mdsal-broker</feature>
+        <feature version='${project.version}'>odl-mdsal-restconf</feature>
+    </feature>
+    <feature name='odl-mdsal-commons' version='${project.version}'>
+        <feature version='${yangtools.version}'>yangtools-concepts</feature>
+        <feature version='${yangtools.version}'>yangtools-binding</feature>
+        <bundle>mvn:org.opendaylight.controller/sal-common/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-common-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-common-impl/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-common-util/${project.version}</bundle>
+        <bundle>wrap:mvn:com.google.guava/guava/${guava.version}</bundle>
+        <bundle>wrap:mvn:org.eclipse.xtend/org.eclipse.xtend.lib/${xtend.version}</bundle>
+    </feature>
+    <feature name='odl-mdsal-broker' version='${project.version}'>
+        <feature version='${yangtools.version}'>yangtools-concepts</feature>
+        <feature version='${yangtools.version}'>yangtools-binding</feature>
+        <feature version='${mdsal.version}'>odl-mdsal-commons</feature>
+        <feature version='${config.version}'>odl-config-subsystem</feature>
+        <bundle>mvn:org.opendaylight.controller/sal-core-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-core-spi/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-broker-impl/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-binding-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-binding-config/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-binding-broker-impl/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-binding-util/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-connector-api/${project.version}</bundle>
+    </feature>
+    <feature name='odl-mdsal-restconf' version='${project.version}'>
+        <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
+        <bundle>mvn:org.opendaylight.controller/sal-rest-connector/${project.version}</bundle>
+        <bundle>wrap:mvn:com.google.code.gson/gson/${gson.version}</bundle>
+        <bundle>wrap:mvn:com.sun.jersey/jersey-core/${jersey.version}</bundle>
+        <bundle>wrap:mvn:com.sun.jersey/jersey-server/${jersey.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller.thirdparty/com.sun.jersey.jersey-servlet/${jersey.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-buffer/${netty.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-codec/${netty.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-codec-http/${netty.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-common/${netty.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-handler/${netty.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-transport/${netty.version}</bundle>
+    </feature>
+</features>
\ No newline at end of file
index 451edfd..edc9bf0 100644 (file)
         -->
     <!-- Documentation -->
     <module>sal-rest-docgen</module>
+
+    <!--  Karaf feature -->
+    <module>feature</module>
+
   </modules>
 
   <build>
index 4141bba..cf754cc 100644 (file)
@@ -10,10 +10,6 @@ package org.opendaylight.controller.sal.binding.codegen.impl;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import javassist.ClassPool;
-import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeGenerator;
-import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory;
-
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -22,8 +18,15 @@ import java.util.concurrent.RejectedExecutionHandler;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
+import javassist.ClassPool;
+import org.apache.commons.lang3.StringUtils;
+import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeGenerator;
+import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class SingletonHolder {
+    private static final Logger logger = LoggerFactory.getLogger(SingletonHolder.class);
 
     public static final ClassPool CLASS_POOL = ClassPool.getDefault();
     public static final org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator RPC_GENERATOR_IMPL = new org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator(
@@ -34,8 +37,9 @@ public class SingletonHolder {
     public static final int CORE_NOTIFICATION_THREADS = 4;
     public static final int MAX_NOTIFICATION_THREADS = 32;
     // block caller thread after MAX_NOTIFICATION_THREADS + MAX_NOTIFICATION_QUEUE_SIZE pending notifications
-    public static final int MAX_NOTIFICATION_QUEUE_SIZE = 10;
+    public static final int MAX_NOTIFICATION_QUEUE_SIZE = 1000;
     public static final int NOTIFICATION_THREAD_LIFE = 15;
+    private static final String NOTIFICATION_QUEUE_SIZE_PROPERTY = "mdsal.notificationqueue.size";
 
     private static ListeningExecutorService NOTIFICATION_EXECUTOR = null;
     private static ListeningExecutorService COMMIT_EXECUTOR = null;
@@ -46,14 +50,25 @@ public class SingletonHolder {
      *             should use service injection to make the executor configurable.
      */
     @Deprecated
-    public static synchronized final ListeningExecutorService getDefaultNotificationExecutor() {
+    public static synchronized ListeningExecutorService getDefaultNotificationExecutor() {
 
         if (NOTIFICATION_EXECUTOR == null) {
+            int queueSize = MAX_NOTIFICATION_QUEUE_SIZE;
+            String queueValue = System.getProperty(NOTIFICATION_QUEUE_SIZE_PROPERTY);
+            if (StringUtils.isNotBlank(queueValue)) {
+                try {
+                    queueSize = Integer.parseInt(queueValue);
+                    logger.trace("Queue size was set to {}", queueSize);
+                }catch(NumberFormatException e) {
+                    logger.warn("Cannot parse {} as set by {}, using default {}", queueValue,
+                            NOTIFICATION_QUEUE_SIZE_PROPERTY, queueSize);
+                }
+            }
             // Overriding the queue:
             // ThreadPoolExecutor would not create new threads if the queue is not full, thus adding
             // occurs in RejectedExecutionHandler.
             // This impl saturates threadpool first, then queue. When both are full caller will get blocked.
-            BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(MAX_NOTIFICATION_QUEUE_SIZE) {
+            BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(queueSize) {
                 @Override
                 public boolean offer(Runnable r) {
                     // ThreadPoolExecutor will spawn a new thread after core size is reached only if the queue.offer returns false.
@@ -89,7 +104,7 @@ public class SingletonHolder {
      *             should use service injection to make the executor configurable.
      */
     @Deprecated
-    public static synchronized final ListeningExecutorService getDefaultCommitExecutor() {
+    public static synchronized ListeningExecutorService getDefaultCommitExecutor() {
         if (COMMIT_EXECUTOR == null) {
             ThreadFactory factory = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("md-sal-binding-commit-%d").build();
             /*

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.