You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by am...@apache.org on 2017/06/25 01:32:24 UTC

[2/6] drill git commit: DRILL-5568: Include hadoop-common jars inside drill-jdbc-all.jar 1) Introduce a new file inside exec/jdbc-all resource package which contains the property key/value pair for prefix 2) At build time based upon the profile choosen t

DRILL-5568: Include hadoop-common jars inside drill-jdbc-all.jar 1) Introduce a new file inside exec/jdbc-all resource package which contains the property key/value pair for prefix 2) At build time based upon the profile choosen this property value is set inside the file 3) It is later consumed by SecurityConfiguration class to rename classpath for classes inside hadoop package.

DRILL-5568: Code review changes

close apache/drill#849


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/886ccdc1
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/886ccdc1
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/886ccdc1

Branch: refs/heads/master
Commit: 886ccdc1a850a0dc054a37797f45cba409b1d0a4
Parents: 964a947
Author: Sorabh Hamirwasia <sh...@maprtech.com>
Authored: Mon Jun 5 13:45:27 2017 -0700
Committer: Aman Sinha <as...@maprtech.com>
Committed: Sat Jun 24 09:17:03 2017 -0700

----------------------------------------------------------------------
 .../rpc/security/SecurityConfiguration.java     |  68 ++++
 .../rpc/security/kerberos/KerberosFactory.java  |   3 +-
 .../exec/rpc/security/plain/PlainFactory.java   |   3 +-
 exec/jdbc-all/pom.xml                           | 310 ++++++++++++++++++-
 exec/jdbc-all/src/main/resources/profile.props  |  18 ++
 .../apache/drill/jdbc/impl/DrillFactory.java    |   6 +-
 6 files changed, 397 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/886ccdc1/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/SecurityConfiguration.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/SecurityConfiguration.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/SecurityConfiguration.java
new file mode 100644
index 0000000..275fd84
--- /dev/null
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/SecurityConfiguration.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.rpc.security;
+
+import com.google.common.base.Strings;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.CommonConfigurationKeys;
+
+import java.io.InputStream;
+import java.util.Properties;
+
+
+public class SecurityConfiguration extends Configuration {
+  //private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SecurityConfiguration.class);
+
+  static {
+    Properties prop = new Properties();
+    try {
+      // Load the properties file containing the namespace prefix based on profile used
+      // to build jdbc-all package. This prefix is used to add on certain Hadoop classes class path.
+      final InputStream inputStream = SecurityConfiguration.class.getClassLoader().getResourceAsStream("profile.props");
+
+      // For null inputStream prop.load() throws NullPointerException
+      // Get the property value and set it in system property
+      prop.load(inputStream);
+      System.setProperty("drill.security.namespacePrefix", prop.getProperty("package.namespace.prefix").trim());
+
+    } catch (Exception ex) {
+      // Ignore the exception which means that property value will be null and is handled in consumer of System Property
+    }
+  }
+
+  public SecurityConfiguration() {
+    super();
+    updateGroupMapping();
+  }
+
+  /**
+   * Update the GroupMapping class name to add namespace prefix retrieved from System Property. This is needed since
+   * in drill-jdbc-all jar we are packaging hadoop dependencies under that namespace. This will help application
+   * using this jar as driver to avoid conflict with it's own hadoop dependency if any. The property is needed only
+   * when Hadoop classes are relocated to different namespace which is done inside jdbc-all package. For normal build
+   * this property is not required as Hadoop classes will be used normally.
+   */
+  private void updateGroupMapping() {
+    final String originalClassName = get(CommonConfigurationKeys.HADOOP_SECURITY_GROUP_MAPPING);
+    final String profilePrefix = System.getProperty("drill.security.namespacePrefix");
+
+    if (!Strings.isNullOrEmpty(profilePrefix)) {
+      set(CommonConfigurationKeys.HADOOP_SECURITY_GROUP_MAPPING, profilePrefix + originalClassName);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/drill/blob/886ccdc1/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/kerberos/KerberosFactory.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/kerberos/KerberosFactory.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/kerberos/KerberosFactory.java
index e14d411..cc4146e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/kerberos/KerberosFactory.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/kerberos/KerberosFactory.java
@@ -22,6 +22,7 @@ import org.apache.drill.common.config.DrillProperties;
 import org.apache.drill.exec.rpc.security.AuthenticatorFactory;
 import org.apache.drill.exec.rpc.security.FastSaslClientFactory;
 import org.apache.drill.exec.rpc.security.FastSaslServerFactory;
+import org.apache.drill.exec.rpc.security.SecurityConfiguration;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.CommonConfigurationKeys;
 import org.apache.hadoop.security.HadoopKerberosName;
@@ -56,7 +57,7 @@ public class KerberosFactory implements AuthenticatorFactory {
 
   @Override
   public UserGroupInformation createAndLoginUser(final Map<String, ?> properties) throws IOException {
-    final Configuration conf = new Configuration();
+    final Configuration conf = new SecurityConfiguration();
     conf.set(CommonConfigurationKeys.HADOOP_SECURITY_AUTHENTICATION,
         UserGroupInformation.AuthenticationMethod.KERBEROS.toString());
     UserGroupInformation.setConfiguration(conf);

http://git-wip-us.apache.org/repos/asf/drill/blob/886ccdc1/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/plain/PlainFactory.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/plain/PlainFactory.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/plain/PlainFactory.java
index 4a0db95..d20faf0 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/plain/PlainFactory.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/plain/PlainFactory.java
@@ -20,6 +20,7 @@ package org.apache.drill.exec.rpc.security.plain;
 import org.apache.drill.common.config.DrillProperties;
 import org.apache.drill.exec.rpc.security.AuthenticatorFactory;
 import org.apache.drill.exec.rpc.security.FastSaslClientFactory;
+import org.apache.drill.exec.rpc.security.SecurityConfiguration;
 import org.apache.drill.exec.rpc.user.security.UserAuthenticator;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.security.UserGroupInformation;
@@ -58,7 +59,7 @@ public class PlainFactory implements AuthenticatorFactory {
 
   @Override
   public UserGroupInformation createAndLoginUser(Map<String, ?> properties) throws IOException {
-    final Configuration conf = new Configuration();
+    final Configuration conf = new SecurityConfiguration();
     UserGroupInformation.setConfiguration(conf);
     try {
       return UserGroupInformation.getCurrentUser();

http://git-wip-us.apache.org/repos/asf/drill/blob/886ccdc1/exec/jdbc-all/pom.xml
----------------------------------------------------------------------
diff --git a/exec/jdbc-all/pom.xml b/exec/jdbc-all/pom.xml
index 17af111..238288e 100644
--- a/exec/jdbc-all/pom.xml
+++ b/exec/jdbc-all/pom.xml
@@ -81,10 +81,6 @@
         </exclusion>
         <exclusion>
           <groupId>org.apache.hadoop</groupId>
-          <artifactId>hadoop-common</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.hadoop</groupId>
           <artifactId>hadoop-client</artifactId>
         </exclusion>
         <exclusion>
@@ -184,6 +180,14 @@
   </dependencies>
 
   <build>
+
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
+
     <plugins>
 
       <plugin>
@@ -265,12 +269,12 @@
           <!--dependencyReducedPomLocation>${project.build.directory}/generated/shade/dependency-reduced-pom.xml</dependencyReducedPomLocation-->
           <minimizeJar>false</minimizeJar>
 
+	  <!-- Exclude dependencies at artifact level. Format is "groupId:artifactId[[:type]:classifier]" -->
           <artifactSet>
             <includes>
               <include>*:*</include>
             </includes>
             <excludes>
-              <exclude>org.slf4j:jcl-over-slf4j</exclude>
               <exclude>com.dyuproject.protostuff:*</exclude>
               <exclude>org.apache.calcite:calcite-core</exclude>
               <exclude>org.apache.calcite:calcite-linq4j</exclude>
@@ -305,7 +309,13 @@
               <exclude>org.mockito:mockito-core</exclude>
               <exclude>org.objenesis:objenesis</exclude>
               <exclude>org.eclipse.jetty:*</exclude>
+              <exclude>javax.xml.bind:jaxb-api</exclude>
+              <exclude>javax.xml.stream:stax-api</exclude>
+              <exclude>javax.activation:activation</exclude>
+              <exclude>commons-cli:commons-cli</exclude>
               <exclude>commons-io:commons-io</exclude>
+              <exclude>commons-beanutils:commons-beanutils-core:jar:*</exclude>
+              <exclude>commons-beanutils:commons-beanutils:jar:*</exclude>
             </excludes>
           </artifactSet>
           <relocations>
@@ -367,12 +377,15 @@
             <relocation><pattern>org.apache.xmlcommons.</pattern><shadedPattern>oadd.org.apache.xmlcommons.</shadedPattern></relocation>
             <relocation><pattern>org.apache.xpath.</pattern><shadedPattern>oadd.org.apache.xpath.</shadedPattern></relocation>
             <relocation><pattern>org.apache.zookeeper.</pattern><shadedPattern>oadd.org.apache.zookeeper.</shadedPattern></relocation>
+            <relocation><pattern>org.apache.hadoop.</pattern><shadedPattern>oadd.org.apache.hadoop.</shadedPattern></relocation>
           </relocations>
           <transformers>
             <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
               <resource>drill-module.conf</resource>
             </transformer>
           </transformers>
+
+         <!-- Remove the particular directory or class level dependency from final jar -->
          <filters>
            <filter>
              <artifact>*:*</artifact>
@@ -424,6 +437,28 @@
                <exclude>org/apache/drill/exec/server/rest/**</exclude>
                <exclude>org/apache/drill/exec/rpc/data/**</exclude>
                <exclude>org/apache/drill/exec/rpc/control/**</exclude>
+               <exclude>org/apache/drill/exec/work/**</exclude>
+               <exclude>org/apache/hadoop/crypto/**</exclude>
+               <exclude>org/apache/hadoop/ha/**</exclude>
+               <exclude>org/apache/hadoop/http/**</exclude>
+               <exclude>org/apache/hadoop/ipc/**</exclude>
+               <exclude>org/apache/hadoop/jmx/**</exclude>
+               <exclude>org/apache/hadoop/log/**</exclude>
+               <exclude>org/apache/hadoop/metrics/**</exclude>
+               <exclude>org/apache/hadoop/net/**</exclude>
+               <exclude>org/apache/hadoop/record/**</exclude>
+               <exclude>org/apache/hadoop/service/**</exclude>
+               <exclude>org/apache/hadoop/tracing/**</exclude>
+               <exclude>org/apache/hadoop/tools/**</exclude>
+               <exclude>org/apache/hadoop/yarn/**</exclude>
+               <exclude>org/apache/commons/pool2/**</exclude>
+               <exclude>org/apache/http/**</exclude>
+               <exclude>org/apache/directory/**</exclude>
+               <exclude>com/jcraft/**</exclude>
+               <exclude>**/mapr/**</exclude>
+               <exclude>org/yaml/**</exclude>
+               <exclude>hello/**</exclude>
+               <exclude>webapps/**</exclude>
              </excludes>
            </filter>
          </filters>
@@ -450,7 +485,7 @@
                   This is likely due to you adding new dependencies to a java-exec and not updating the excludes in this module. This is important as it minimizes the size of the dependency of Drill application users.
 
                   </message>
-                  <maxsize>22000000</maxsize>
+                  <maxsize>29000000</maxsize>
                   <minsize>15000000</minsize>
                   <files>
                    <file>${project.build.directory}/drill-jdbc-all-${project.version}.jar</file>
@@ -483,6 +518,269 @@
 
   <profiles>
     <profile>
+      <id>default</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <properties>
+        <package.namespace.prefix>oadd.</package.namespace.prefix>
+      </properties>
+    </profile>
+      <profile>
+        <id>mapr</id>
+        <properties>
+          <package.namespace.prefix></package.namespace.prefix>
+        </properties>
+
+        <build>
+          <plugins>
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-enforcer-plugin</artifactId>
+              <executions>
+                <execution>
+                  <id>enforce-jdbc-jar-compactness</id>
+                  <goals>
+                    <goal>enforce</goal>
+                  </goals>
+                  <phase>verify</phase>
+                  <configuration>
+                    <rules>
+                      <requireFilesSize>
+                        <message>
+
+                          The file drill-jdbc-all-${project.version}.jar is outside the expected size range.
+
+                          This is likely due to you adding new dependencies to a java-exec and not updating the excludes in this module. This is important as it minimizes the size of the dependency of Drill application users.
+
+                        </message>
+                        <maxsize>29000000</maxsize>
+                        <minsize>15000000</minsize>
+                        <files>
+                          <file>${project.build.directory}/drill-jdbc-all-${project.version}.jar</file>
+                        </files>
+                      </requireFilesSize>
+                    </rules>
+                    <fail>true</fail>
+                  </configuration>
+                </execution>
+              </executions>
+            </plugin>
+
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-shade-plugin</artifactId>
+              <version>2.4.1</version>
+              <executions>
+                <execution>
+                  <phase>package</phase>
+                  <goals>
+                    <goal>shade</goal>
+                  </goals>
+                </execution>
+              </executions>
+              <configuration>
+                <shadedArtifactAttached>false</shadedArtifactAttached>
+                <createDependencyReducedPom>true</createDependencyReducedPom>
+                <!-- TODO DRILL-4336: try to move the dependencyReducedPom out of the default location (the module root).
+                     Putting it here caused the target directory to be run as a submodule (oddly
+                     only when trying to run the maven release goal) -->
+                <!--dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation-->
+                <!-- TODO DRILL-4336: an attempt to fix the issue by moving the file elsewhere, had issues executing
+                     but may be able to be modified to to fix the issue-->
+                <!--dependencyReducedPomLocation>${project.build.directory}/generated/shade/dependency-reduced-pom.xml</dependencyReducedPomLocation-->
+                <minimizeJar>false</minimizeJar>
+
+                <!-- Exclude dependencies at artifact level. Format is "groupId:artifactId[[:type]:classifier]" -->
+                <artifactSet>
+                  <includes>
+                    <include>*:*</include>
+                  </includes>
+                  <excludes>
+                    <exclude>org.slf4j:jcl-over-slf4j</exclude>
+                    <exclude>com.dyuproject.protostuff:*</exclude>
+                    <exclude>org.apache.calcite:calcite-core</exclude>
+                    <exclude>org.apache.calcite:calcite-linq4j</exclude>
+                    <exclude>org.pentaho:*</exclude>
+                    <exclude>org.msgpack:*</exclude>
+                    <exclude>xerces:*</exclude>
+                    <exclude>xalan:*</exclude>
+                    <exclude>org.apache.avro:*</exclude>
+                    <exclude>org.mongodb:*</exclude>
+                    <exclude>com.googlecode.json-simple:*</exclude>
+                    <exclude>dom4j:*</exclude>
+                    <exclude>org.hibernate:*</exclude>
+                    <exclude>antlr:*</exclude>
+                    <exclude>org.ow2.asm:*</exclude>
+                    <exclude>com.univocity:*</exclude>
+                    <exclude>net.sf.jpam:*</exclude>
+                    <exclude>com.twitter:*</exclude>
+                    <exclude>org.apache.parquet:*</exclude>
+                    <exclude>javax.inject:*</exclude>
+                    <exclude>com.beust:*</exclude>
+                    <exclude>jline:*</exclude>
+                    <exclude>io.netty:netty:jar:3.7.0.Final</exclude>
+                    <exclude>org.xerial.snappy:*</exclude>
+                    <exclude>org.apache.avro:*</exclude>
+                    <exclude>org.tukaani:*</exclude>
+                    <exclude>org.apache.velocity:*</exclude>
+                    <exclude>net.hydromatic:linq4j</exclude>
+                    <exclude>org.codehaus.janino:*</exclude>
+                    <exclude>org.mortbay.jetty:*</exclude>
+                    <exclude>org.slf4j:jul-to-slf4j</exclude>
+                    <exclude>org.slf4j:log4j-over-slf4j</exclude>
+                    <exclude>org.hamcrest:hamcrest-core</exclude>
+                    <exclude>org.mockito:mockito-core</exclude>
+                    <exclude>org.objenesis:objenesis</exclude>
+                    <exclude>org.eclipse.jetty:*</exclude>
+                    <exclude>org.apache.hadoop:*</exclude>
+                    <exclude>javax.xml.bind:jaxb-api</exclude>
+                    <exclude>javax.xml.stream:stax-api</exclude>
+                    <exclude>javax.activation:activation</exclude>
+                    <exclude>commons-cli:commons-cli</exclude>
+                    <exclude>commons-io:commons-io</exclude>
+                    <exclude>commons-beanutils:commons-beanutils-core:jar:*</exclude>
+                    <exclude>commons-beanutils:commons-beanutils:jar:*</exclude>
+                  </excludes>
+                </artifactSet>
+                <relocations>
+                  <!-- Relocate Drill classes to minimize classloader hell. -->
+                  <relocation><pattern>org.apache.drill.exec.</pattern><shadedPattern>oadd.org.apache.drill.exec.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.drill.common.</pattern><shadedPattern>oadd.org.apache.drill.common.</shadedPattern></relocation>
+
+                  <!-- Move dependencies out of path -->
+                  <relocation><pattern>antlr.</pattern><shadedPattern>oadd.antlr.</shadedPattern></relocation>
+                  <relocation><pattern>antlr.</pattern><shadedPattern>oadd.antlr.</shadedPattern></relocation>
+                  <relocation><pattern>io.</pattern><shadedPattern>oadd.io.</shadedPattern></relocation>
+                  <relocation><pattern>javacc.</pattern><shadedPattern>oadd.javacc.</shadedPattern></relocation>
+                  <relocation><pattern>java_cup.</pattern><shadedPattern>oadd.java_cup.</shadedPattern></relocation>
+                  <relocation><pattern>javassist.</pattern><shadedPattern>oadd.javassist.</shadedPattern></relocation>
+                  <relocation><pattern>jline.</pattern><shadedPattern>oadd.jline.</shadedPattern></relocation>
+                  <relocation><pattern>license.</pattern><shadedPattern>oadd.license.</shadedPattern></relocation>
+                  <relocation><pattern>net.</pattern><shadedPattern>oadd.net.</shadedPattern></relocation>
+                  <relocation><pattern>parquet.</pattern><shadedPattern>oadd.parquet.</shadedPattern></relocation>
+                  <relocation><pattern>test.</pattern><shadedPattern>oadd.test.</shadedPattern></relocation>
+                  <relocation><pattern>trax.</pattern><shadedPattern>oadd.trax.</shadedPattern></relocation>
+                  <relocation><pattern>org.antlr.</pattern><shadedPattern>oadd.org.antlr.</shadedPattern></relocation>
+                  <relocation><pattern>org.codehaus.</pattern><shadedPattern>oadd.org.codehaus.</shadedPattern></relocation>
+                  <relocation><pattern>org.eigenbase.</pattern><shadedPattern>oadd.org.eigenbase.</shadedPattern></relocation>
+                  <relocation><pattern>org.hamcrest.</pattern><shadedPattern>oadd.org.hamcrest.</shadedPattern></relocation>
+                  <relocation><pattern>org.jboss.</pattern><shadedPattern>oadd.org.jboss.</shadedPattern></relocation>
+                  <relocation><pattern>org.joda.</pattern><shadedPattern>oadd.org.joda.</shadedPattern></relocation>
+                  <relocation><pattern>org.json.</pattern><shadedPattern>oadd.org.json.</shadedPattern></relocation>
+                  <relocation><pattern>org.mockito.</pattern><shadedPattern>oadd.org.mockito.</shadedPattern></relocation>
+                  <relocation><pattern>org.msgpack.</pattern><shadedPattern>oadd.org.msgpack.</shadedPattern></relocation>
+                  <relocation><pattern>org.objectweb.</pattern><shadedPattern>oadd.org.objectweb.</shadedPattern></relocation>
+                  <relocation><pattern>org.objensis.</pattern><shadedPattern>oadd.org.objensis.</shadedPattern></relocation>
+                  <relocation><pattern>org.pentaho.</pattern><shadedPattern>oadd.org.pentaho.</shadedPattern></relocation>
+                  <relocation><pattern>org.reflections.</pattern><shadedPattern>oadd.org.reflections.</shadedPattern></relocation>
+                  <relocation><pattern>org.tukaani.</pattern><shadedPattern>oadd.org.tukaani.</shadedPattern></relocation>
+                  <relocation><pattern>org.xerial.</pattern><shadedPattern>oadd.org.xerial.</shadedPattern></relocation>
+                  <relocation><pattern>com.beust.</pattern><shadedPattern>oadd.com.beust.</shadedPattern></relocation>
+                  <relocation><pattern>com.carrotsearch.</pattern><shadedPattern>oadd.com.carrotsearch.</shadedPattern></relocation>
+                  <relocation><pattern>com.codahale.</pattern><shadedPattern>oadd.com.codahale.</shadedPattern></relocation>
+                  <relocation><pattern>com.dyuproject.</pattern><shadedPattern>oadd.com.dyuproject.</shadedPattern></relocation>
+                  <relocation><pattern>com.fasterxml.</pattern><shadedPattern>oadd.com.fasterxml.</shadedPattern></relocation>
+                  <relocation><pattern>com.google.</pattern><shadedPattern>oadd.com.google.</shadedPattern></relocation>
+                  <relocation><pattern>com.thoughtworks.</pattern><shadedPattern>oadd.com.thoughtworks.</shadedPattern></relocation>
+                  <relocation><pattern>com.typesafe.</pattern><shadedPattern>oadd.com.typesafe.</shadedPattern></relocation>
+                  <relocation><pattern>com.univocity.</pattern><shadedPattern>oadd.com.univocity.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.avro.</pattern><shadedPattern>oadd.org.apache.avro.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.bcel.</pattern><shadedPattern>oadd.org.apache.bcel.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.calcite.</pattern><shadedPattern>oadd.org.apache.calcite.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.commons.</pattern><shadedPattern>oadd.org.apache.commons.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.curator.</pattern><shadedPattern>oadd.org.apache.curator.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.html.</pattern><shadedPattern>oadd.org.apache.html.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.jute.</pattern><shadedPattern>oadd.org.apache.jute.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.log4j.</pattern><shadedPattern>oadd.org.apache.log4j.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.regexp.</pattern><shadedPattern>oadd.org.apache.regexp.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.velocity.</pattern><shadedPattern>oadd.org.apache.velocity.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.wml.</pattern><shadedPattern>oadd.org.apache.wml.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.xalan.</pattern><shadedPattern>oadd.org.apache.xalan.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.xerces.</pattern><shadedPattern>oadd.org.apache.xerces.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.xml.</pattern><shadedPattern>oadd.org.apache.xml.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.xmlcommons.</pattern><shadedPattern>oadd.org.apache.xmlcommons.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.xpath.</pattern><shadedPattern>oadd.org.apache.xpath.</shadedPattern></relocation>
+                  <relocation><pattern>org.apache.zookeeper.</pattern><shadedPattern>oadd.org.apache.zookeeper.</shadedPattern></relocation>
+                </relocations>
+                <transformers>
+                  <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+                    <resource>drill-module.conf</resource>
+                  </transformer>
+                </transformers>
+
+                <!-- Remove the particular directory or class level dependency from final jar -->
+                <filters>
+                  <filter>
+                    <artifact>*:*</artifact>
+                    <excludes>
+                      <exclude>**/logback.xml</exclude>
+                      <exclude>**/LICENSE.txt</exclude>
+                      <exclude>**/*.java</exclude>
+                      <exclude>META-INF/ASL2.0</exclude>
+                      <exclude>META-INF/NOTICE.txt</exclude>
+                      <exclude>META-INF/drill-module-scan/**</exclude>
+                      <exclude>META-INF/jboss-beans.xml</exclude>
+                      <exclude>META-INF/license/**</exclude>
+                      <exclude>META-INF/maven/**</exclude>
+                      <exclude>META-INF/native/**</exclude>
+                      <exclude>META-INF/services/com.fasterxml.*</exclude>
+                      <exclude>META-INF/services/javax.ws.*</exclude>
+                      <exclude>META-INF/**/*.properties</exclude>
+                      <exclude>**/org.codehaus.commons.compiler.properties</exclude>
+                      <exclude>**/*.SF</exclude>
+                      <exclude>**/*.RSA</exclude>
+                      <exclude>**/*.DSA</exclude>
+                      <exclude>javax/*</exclude>
+                      <exclude>javax/activation/**</exclude>
+                      <exclude>javax/annotation-api/**</exclude>
+                      <exclude>javax/inject/**</exclude>
+                      <exclude>javax/servlet-api/**</exclude>
+                      <exclude>javax/json/**</exclude>
+                      <exclude>javax/ws/**</exclude>
+                      <exclude>rest/**</exclude>
+                      <exclude>*.tokens</exclude>
+                      <exclude>codegen/**</exclude>
+                      <exclude>bootstrap-storage-plugins.json</exclude>
+                      <exclude>org/apache/parquet</exclude>
+                      <exclude>com/google/common/math</exclude>
+                      <exclude>com/google/common/net</exclude>
+                      <exclude>com/google/common/primitives</exclude>
+                      <exclude>com/google/common/reflect</exclude>
+                      <exclude>com/google/common/util</exclude>
+                      <exclude>com/google/common/cache</exclude>
+                      <exclude>com/google/common/collect/Tree*</exclude>
+                      <exclude>com/google/common/collect/Standard*</exclude>
+                      <exclude>org/apache/drill/exec/expr/annotations/**</exclude>
+                      <exclude>org/apache/drill/exec/expr/fn/**</exclude>
+                      <exclude>org/apache/drill/exec/proto/beans/**</exclude>
+                      <exclude>org/apache/drill/exec/compile/**</exclude>
+                      <exclude>org/apache/drill/exec/planner/**</exclude>
+                      <exclude>org/apache/drill/exec/physical/**</exclude>
+                      <exclude>org/apache/drill/exec/store/**</exclude>
+                      <exclude>org/apache/drill/exec/server/rest/**</exclude>
+                      <exclude>org/apache/drill/exec/rpc/data/**</exclude>
+                      <exclude>org/apache/drill/exec/rpc/control/**</exclude>
+                      <exclude>org/apache/drill/exec/work/**</exclude>
+                      <exclude>org/apache/hadoop/**</exclude>
+                      <exclude>org/apache/commons/pool2/**</exclude>
+                      <exclude>org/apache/http/**</exclude>
+                      <exclude>org/apache/directory/**</exclude>
+                      <exclude>com/jcraft/**</exclude>
+                      <exclude>**/mapr/**</exclude>
+                      <exclude>org/yaml/**</exclude>
+                      <exclude>hello/**</exclude>
+                      <exclude>webapps/**</exclude>
+                    </excludes>
+                  </filter>
+                </filters>
+              </configuration>
+            </plugin>
+          </plugins>
+
+        </build>
+      </profile>
+    <profile>
       <id>apache-release</id>
       <build>
         <plugins>

http://git-wip-us.apache.org/repos/asf/drill/blob/886ccdc1/exec/jdbc-all/src/main/resources/profile.props
----------------------------------------------------------------------
diff --git a/exec/jdbc-all/src/main/resources/profile.props b/exec/jdbc-all/src/main/resources/profile.props
new file mode 100644
index 0000000..4ed395a
--- /dev/null
+++ b/exec/jdbc-all/src/main/resources/profile.props
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+package.namespace.prefix=${package.namespace.prefix}

http://git-wip-us.apache.org/repos/asf/drill/blob/886ccdc1/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillFactory.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillFactory.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillFactory.java
index 0c3c3e8..15bc88b 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillFactory.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillFactory.java
@@ -18,13 +18,13 @@
 
 package org.apache.drill.jdbc.impl;
 
-import java.sql.SQLException;
-import java.util.Properties;
-
 import org.apache.calcite.avatica.AvaticaConnection;
 import org.apache.calcite.avatica.AvaticaFactory;
 import org.apache.calcite.avatica.UnregisteredDriver;
 
+import java.sql.SQLException;
+import java.util.Properties;
+
 
 /**
  * Partial implementation of {@link net.hydromatic.avatica.AvaticaFactory}