You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by ka...@apache.org on 2018/07/10 14:39:23 UTC

sentry git commit: SENTRY-2283 Multiple versions of metrics on the classpath causes Sentry to not startup (Steve Moist reviewed by Kalyan Kumar Kalvagadda)

Repository: sentry
Updated Branches:
  refs/heads/master dbf83ab2b -> 4d9665f60


SENTRY-2283 Multiple versions of metrics on the classpath causes Sentry to not startup (Steve Moist reviewed by Kalyan Kumar Kalvagadda)


Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/4d9665f6
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/4d9665f6
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/4d9665f6

Branch: refs/heads/master
Commit: 4d9665f60c240eba17356c6c91646c1c357a62d5
Parents: dbf83ab
Author: Kalyan Kumar Kalvagadda <kk...@cloudera.com>
Authored: Tue Jul 10 09:38:21 2018 -0500
Committer: Kalyan Kumar Kalvagadda <kk...@cloudera.com>
Committed: Tue Jul 10 09:38:21 2018 -0500

----------------------------------------------------------------------
 pom.xml                                         | 14 +++++++-
 sentry-binding/sentry-binding-kafka/pom.xml     |  6 ++++
 sentry-dist/src/license/THIRD-PARTY.properties  |  2 +-
 sentry-dist/src/main/assembly/bin.xml           |  2 ++
 sentry-hdfs/sentry-hdfs-dist/pom.xml            |  2 +-
 .../apache/sentry/hdfs/PathDeltaRetriever.java  |  2 +-
 .../apache/sentry/hdfs/PathImageRetriever.java  |  2 +-
 .../apache/sentry/hdfs/PermDeltaRetriever.java  |  2 +-
 .../apache/sentry/hdfs/PermImageRetriever.java  |  2 +-
 .../sentry/hdfs/SentryHDFSServiceProcessor.java |  2 +-
 .../sentry/hdfs/SentryHdfsMetricsUtil.java      |  8 ++---
 sentry-provider/sentry-provider-db/pom.xml      | 16 +++++++--
 sentry-service/sentry-service-server/pom.xml    | 11 +++++-
 sentry-tests/sentry-tests-solr/pom.xml          | 37 --------------------
 sentry-tests/sentry-tests-sqoop/pom.xml         |  1 +
 15 files changed, 57 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4884265..dcf1076 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,7 @@ limitations under the License.
     <maven.antrun.plugin.version>1.7</maven.antrun.plugin.version>
     <maven.eclipse.plugin.version>2.9</maven.eclipse.plugin.version>
     <maven.enforcer.plugin.version>1.3.1</maven.enforcer.plugin.version>
-    <maven.shade.plugin.version>2.4.3</maven.shade.plugin.version>
+    <maven.shade.plugin.version>3.1.1</maven.shade.plugin.version>
     <metrics.version>3.2.2</metrics.version>
     <mockito.version>1.8.5</mockito.version>
     <objenesis.version>1.2</objenesis.version>
@@ -436,6 +436,10 @@ limitations under the License.
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-web</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>com.yammer.metrics</groupId>
+            <artifactId>metrics-core</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
       <dependency>
@@ -451,6 +455,10 @@ limitations under the License.
             <groupId>org.apache.curator</groupId>
             <artifactId>curator-client</artifactId>
           </exclusion>
+            <exclusion>
+              <groupId>com.yammer.metrics</groupId>
+              <artifactId>metrics-core</artifactId>
+            </exclusion>
         </exclusions>
       </dependency>
       <dependency>
@@ -742,6 +750,10 @@ limitations under the License.
             <groupId>javax.jms</groupId>
             <artifactId>jms</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>com.yammer.metrics</groupId>
+            <artifactId>metrics-core</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
     </dependencies>

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-binding/sentry-binding-kafka/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-binding/sentry-binding-kafka/pom.xml b/sentry-binding/sentry-binding-kafka/pom.xml
index 239eeba..e4fdddf 100644
--- a/sentry-binding/sentry-binding-kafka/pom.xml
+++ b/sentry-binding/sentry-binding-kafka/pom.xml
@@ -68,6 +68,12 @@ limitations under the License.
       <groupId>org.apache.kafka</groupId>
       <artifactId>kafka_2.11</artifactId>
       <scope>provided</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>com.yammer.metrics</groupId>
+          <artifactId>metrics-core</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.hadoop</groupId>

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-dist/src/license/THIRD-PARTY.properties
----------------------------------------------------------------------
diff --git a/sentry-dist/src/license/THIRD-PARTY.properties b/sentry-dist/src/license/THIRD-PARTY.properties
index b39e1b6..a1084db 100644
--- a/sentry-dist/src/license/THIRD-PARTY.properties
+++ b/sentry-dist/src/license/THIRD-PARTY.properties
@@ -29,7 +29,7 @@
 # Please fill the missing licenses for dependencies :
 #
 #
-#Mon Apr 30 16:44:05 CDT 2018
+#Mon Jul 09 14:15:21 CDT 2018
 ant--ant--1.5=The Apache Software License, Version 2.0
 asm--asm--3.1=BSD
 dom4j--dom4j--1.6.1=BSD

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-dist/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/sentry-dist/src/main/assembly/bin.xml b/sentry-dist/src/main/assembly/bin.xml
index 72773df..fc012c6 100644
--- a/sentry-dist/src/main/assembly/bin.xml
+++ b/sentry-dist/src/main/assembly/bin.xml
@@ -44,6 +44,8 @@
         <exclude>com.jolbox:bonecp</exclude>
         <exclude>org.apache.hive:hive-beeline</exclude>
         <exclude>org.apache.derby:derby</exclude>
+        <!-- SENTRY-2283 multiple versions of metrics cause failures on startup -->
+        <exclude>io.dropwizard.metrics:*</exclude>
       </excludes>
     </dependencySet>
 <!--

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-hdfs/sentry-hdfs-dist/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-dist/pom.xml b/sentry-hdfs/sentry-hdfs-dist/pom.xml
index 9394315..1e04bf2 100644
--- a/sentry-hdfs/sentry-hdfs-dist/pom.xml
+++ b/sentry-hdfs/sentry-hdfs-dist/pom.xml
@@ -57,7 +57,7 @@ limitations under the License.
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
-        <version>2.3</version>
+        <version>${maven.shade.plugin.version}</version>
         <executions>
           <execution>
             <phase>package</phase>

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathDeltaRetriever.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathDeltaRetriever.java b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathDeltaRetriever.java
index 81c614a..0d39300 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathDeltaRetriever.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathDeltaRetriever.java
@@ -17,7 +17,7 @@
  */
 package org.apache.sentry.hdfs;
 
-import com.codahale.metrics.Timer.Context;
+import sentry.com.codahale.metrics.Timer.Context;
 import org.apache.sentry.provider.db.service.model.MSentryPathChange;
 import org.apache.sentry.provider.db.service.persistent.SentryStoreInterface;
 

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathImageRetriever.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathImageRetriever.java b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathImageRetriever.java
index 3532ef3..2b16181 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathImageRetriever.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathImageRetriever.java
@@ -17,7 +17,7 @@
  */
 package org.apache.sentry.hdfs;
 
-import com.codahale.metrics.Timer;
+import sentry.com.codahale.metrics.Timer;
 import org.apache.sentry.provider.db.service.persistent.SentryStoreInterface;
 
 import javax.annotation.concurrent.ThreadSafe;

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermDeltaRetriever.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermDeltaRetriever.java b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermDeltaRetriever.java
index 8d6713a..b9405cc 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermDeltaRetriever.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermDeltaRetriever.java
@@ -17,7 +17,7 @@
  */
 package org.apache.sentry.hdfs;
 
-import com.codahale.metrics.Timer.Context;
+import sentry.com.codahale.metrics.Timer.Context;
 import org.apache.sentry.hdfs.service.thrift.TPrivilegeChanges;
 import org.apache.sentry.provider.db.service.model.MSentryPermChange;
 import org.apache.sentry.provider.db.service.persistent.SentryStoreInterface;

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermImageRetriever.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermImageRetriever.java b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermImageRetriever.java
index b87d290..2a67504 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermImageRetriever.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermImageRetriever.java
@@ -17,7 +17,7 @@
  */
 package org.apache.sentry.hdfs;
 
-import com.codahale.metrics.Timer.Context;
+import sentry.com.codahale.metrics.Timer.Context;
 import org.apache.sentry.hdfs.service.thrift.TPrivilegeEntity;
 import org.apache.sentry.hdfs.service.thrift.TPermissionsUpdate;
 import org.apache.sentry.hdfs.service.thrift.TPrivilegeChanges;

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHDFSServiceProcessor.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHDFSServiceProcessor.java b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHDFSServiceProcessor.java
index 0cd405b..5e2d5c5 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHDFSServiceProcessor.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHDFSServiceProcessor.java
@@ -23,7 +23,7 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
-import com.codahale.metrics.Timer.Context;
+import sentry.com.codahale.metrics.Timer.Context;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.sentry.hdfs.service.thrift.SentryHDFSService;
 import org.apache.sentry.hdfs.service.thrift.TAuthzUpdateRequest;

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHdfsMetricsUtil.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHdfsMetricsUtil.java b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHdfsMetricsUtil.java
index 3bf300b..f299825 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHdfsMetricsUtil.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHdfsMetricsUtil.java
@@ -18,10 +18,10 @@
 
 package org.apache.sentry.hdfs;
 
-import com.codahale.metrics.Counter;
-import com.codahale.metrics.Histogram;
-import com.codahale.metrics.MetricRegistry;
-import com.codahale.metrics.Timer;
+import sentry.com.codahale.metrics.Counter;
+import sentry.com.codahale.metrics.Histogram;
+import sentry.com.codahale.metrics.MetricRegistry;
+import sentry.com.codahale.metrics.Timer;
 import org.apache.sentry.api.service.thrift.SentryMetrics;
 
 /**

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-provider/sentry-provider-db/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/pom.xml b/sentry-provider/sentry-provider-db/pom.xml
index a8a15bf..bfe91d7 100644
--- a/sentry-provider/sentry-provider-db/pom.xml
+++ b/sentry-provider/sentry-provider-db/pom.xml
@@ -195,14 +195,17 @@ limitations under the License.
     <dependency>
       <groupId>io.dropwizard.metrics</groupId>
       <artifactId>metrics-core</artifactId>
+      <version>${metrics.version}</version>
     </dependency>
     <dependency>
       <groupId>io.dropwizard.metrics</groupId>
       <artifactId>metrics-servlets</artifactId>
+      <version>${metrics.version}</version>
     </dependency>
     <dependency>
       <groupId>io.dropwizard.metrics</groupId>
       <artifactId>metrics-jvm</artifactId>
+      <version>${metrics.version}</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
@@ -304,7 +307,6 @@ limitations under the License.
         <version>${maven.shade.plugin.version}</version>
         <executions>
           <execution>
-            <id>curator-shade</id>
             <phase>package</phase>
             <goals>
               <goal>shade</goal>
@@ -317,6 +319,7 @@ limitations under the License.
                   <include>org.apache.curator:curator-x-discovery</include>
                   <include>org.apache.curator:curator-framework</include>
                   <include>org.apache.curator:curator-client</include>
+                  <include>io.dropwizard.metrics:*</include>
                 </includes>
               </artifactSet>
               <relocations>
@@ -325,8 +328,17 @@ limitations under the License.
                   <pattern>org.apache.curator</pattern>
                   <shadedPattern>sentry.org.apache.curator</shadedPattern>
                 </relocation>
+                <relocation>
+                  <pattern>io.dropwizard.metrics</pattern>
+                  <shadedPattern>sentry.io.dropwizard.metrics</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>com.codahale.metrics</pattern>
+                  <shadedPattern>sentry.com.codahale.metrics</shadedPattern>
+                </relocation>
               </relocations>
-              <shadedArtifactAttached>false</shadedArtifactAttached>
+              <shadeSourcesContent>true</shadeSourcesContent>
+              <createSourcesJar>true</createSourcesJar>
             </configuration>
           </execution>
         </executions>

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-service/sentry-service-server/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-service/sentry-service-server/pom.xml b/sentry-service/sentry-service-server/pom.xml
index a103c1e..b95344e 100644
--- a/sentry-service/sentry-service-server/pom.xml
+++ b/sentry-service/sentry-service-server/pom.xml
@@ -271,7 +271,6 @@ limitations under the License.
                 <version>${maven.shade.plugin.version}</version>
                 <executions>
                     <execution>
-                        <id>curator-shade</id>
                         <phase>package</phase>
                         <goals>
                             <goal>shade</goal>
@@ -284,6 +283,7 @@ limitations under the License.
                                     <include>org.apache.curator:curator-x-discovery</include>
                                     <include>org.apache.curator:curator-framework</include>
                                     <include>org.apache.curator:curator-client</include>
+                                    <include>io.dropwizard.metrics:*</include>
                                 </includes>
                             </artifactSet>
                             <relocations>
@@ -292,8 +292,17 @@ limitations under the License.
                                     <pattern>org.apache.curator</pattern>
                                     <shadedPattern>sentry.org.apache.curator</shadedPattern>
                                 </relocation>
+                                <relocation>
+                                    <pattern>io.dropwizard.metrics</pattern>
+                                    <shadedPattern>sentry.io.dropwizard.metrics</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>com.codahale.metrics</pattern>
+                                    <shadedPattern>sentry.com.codahale.metrics</shadedPattern>
+                                </relocation>
                             </relocations>
                             <shadedArtifactAttached>false</shadedArtifactAttached>
+                            <createSourcesJar>true</createSourcesJar>
                         </configuration>
                     </execution>
                 </executions>

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-tests/sentry-tests-solr/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-solr/pom.xml b/sentry-tests/sentry-tests-solr/pom.xml
index db33ee9..cc0969a 100644
--- a/sentry-tests/sentry-tests-solr/pom.xml
+++ b/sentry-tests/sentry-tests-solr/pom.xml
@@ -118,18 +118,6 @@ limitations under the License.
           <artifactId>hive-beeline</artifactId>
         </exclusion>
         <exclusion>
-          <groupId>io.dropwizard.metrics</groupId>
-          <artifactId>metrics-core</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>io.dropwizard.metrics</groupId>
-          <artifactId>metrics-jvm</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>io.dropwizard.metrics</groupId>
-          <artifactId>metrics-servlets</artifactId>
-        </exclusion>
-        <exclusion>
           <groupId>org.apache.hadoop</groupId>
           <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
         </exclusion>
@@ -267,31 +255,6 @@ limitations under the License.
       <version>${slf4j.version}</version>
     </dependency>
     <dependency>
-      <groupId>io.dropwizard.metrics</groupId>
-      <artifactId>metrics-core</artifactId>
-      <version>3.2.2</version>
-    </dependency>
-    <dependency>
-      <groupId>io.dropwizard.metrics</groupId>
-      <artifactId>metrics-jvm</artifactId>
-      <version>3.2.2</version>
-    </dependency>
-    <dependency>
-      <groupId>io.dropwizard.metrics</groupId>
-      <artifactId>metrics-servlets</artifactId>
-      <version>3.2.2</version>
-    </dependency>
-    <dependency>
-      <groupId>io.dropwizard.metrics</groupId>
-      <artifactId>metrics-ganglia</artifactId>
-      <version>3.2.2</version>
-    </dependency>
-    <dependency>
-      <groupId>io.dropwizard.metrics</groupId>
-      <artifactId>metrics-graphite</artifactId>
-      <version>3.2.2</version>
-    </dependency>
-    <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>javax.servlet-api</artifactId>
       <version>3.1.0</version>

http://git-wip-us.apache.org/repos/asf/sentry/blob/4d9665f6/sentry-tests/sentry-tests-sqoop/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-sqoop/pom.xml b/sentry-tests/sentry-tests-sqoop/pom.xml
index e280c9e..13f8eed 100644
--- a/sentry-tests/sentry-tests-sqoop/pom.xml
+++ b/sentry-tests/sentry-tests-sqoop/pom.xml
@@ -48,6 +48,7 @@ limitations under the License.
           <artifactId>testng</artifactId>
         </exclusion>
       </exclusions>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.hadoop</groupId>