This is an automated email from the ASF dual-hosted git repository.
stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/master by this push:
new b9e0383 PHOENIX-6193 PHOENIX-6151 slows down shading
b9e0383 is described below
commit b9e03834fdfc896e501a83bfc60e9099f5ded21b
Author: Istvan Toth <[email protected]>
AuthorDate: Sat Oct 17 10:54:59 2020 +0200
PHOENIX-6193 PHOENIX-6151 slows down shading
simplify shading rules to speed it up
make client builds parallelizable
make embedded client skippable
change embedded client maven coordinates
---
Jenkinsfile | 2 +-
dev/phoenix-personality.sh | 2 +-
phoenix-assembly/pom.xml | 2 +-
.../src/build/components/all-common-jars.xml | 4 +-
.../phoenix-client-embedded/pom.xml | 66 +++++++++
phoenix-client-parent/phoenix-client/pom.xml | 65 +++++++++
{phoenix-client => phoenix-client-parent}/pom.xml | 159 ++++-----------------
pom.xml | 14 +-
8 files changed, 175 insertions(+), 139 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index d7f08f8..5bb1ebd 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -75,7 +75,7 @@ pipeline {
checkout scm
sh """#!/bin/bash
ulimit -a
- mvn clean verify
-Dhbase.profile=${HBASE_PROFILE} -B
+ mvn clean verify -Dskip.embedded
-Dhbase.profile=${HBASE_PROFILE} -B
"""
}
}
diff --git a/dev/phoenix-personality.sh b/dev/phoenix-personality.sh
index ae5806f..692981e 100755
--- a/dev/phoenix-personality.sh
+++ b/dev/phoenix-personality.sh
@@ -140,7 +140,7 @@ function personality_modules
# Running with threads>1 seems to trigger some problem in the build, but
since we
# spend 80+% of the time in phoenix-core, it wouldn't help much anyway
- extra="--threads=1 -DPhoenixPatchProcess"
+ extra="--threads=1 -DPhoenixPatchProcess -Dskip.embedded"
if [[ "${PATCH_BRANCH}" = 4* ]]; then
extra="${extra} -Dhttps.protocols=TLSv1.2"
fi
diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml
index 099ac03..0a88f97 100644
--- a/phoenix-assembly/pom.xml
+++ b/phoenix-assembly/pom.xml
@@ -49,7 +49,7 @@
</goals>
<configuration>
<executable>ln</executable>
-
<workingDirectory>${project.basedir}/../phoenix-client/target</workingDirectory>
+
<workingDirectory>${project.basedir}/../phoenix-client-parent/phoenix-client/target</workingDirectory>
<arguments>
<argument>-fnsv</argument>
<argument>
diff --git a/phoenix-assembly/src/build/components/all-common-jars.xml
b/phoenix-assembly/src/build/components/all-common-jars.xml
index 8f97784..93f82f2 100644
--- a/phoenix-assembly/src/build/components/all-common-jars.xml
+++ b/phoenix-assembly/src/build/components/all-common-jars.xml
@@ -24,11 +24,10 @@
<!-- Add the client & mapreduce jars. Expects the client jar packaging
phase to already be run,
which is determined by specification order in the pom. -->
<fileSet>
- <directory>${project.basedir}/../phoenix-client/target</directory>
+
<directory>${project.basedir}/../phoenix-client-parent/phoenix-client/target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>phoenix-client-${project.version}.jar</include>
- <include>phoenix-client.jar</include>
</includes>
</fileSet>
<fileSet>
@@ -36,7 +35,6 @@
<outputDirectory>/</outputDirectory>
<includes>
<include>phoenix-server-${project.version}.jar</include>
- <include>phoenix-server.jar</include>
</includes>
</fileSet>
diff --git a/phoenix-client-parent/phoenix-client-embedded/pom.xml
b/phoenix-client-parent/phoenix-client-embedded/pom.xml
new file mode 100644
index 0000000..bd85027
--- /dev/null
+++ b/phoenix-client-parent/phoenix-client-embedded/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<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.apache.phoenix</groupId>
+ <artifactId>phoenix-client-parent</artifactId>
+ <version>5.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>phoenix-client-embedded</artifactId>
+ <name>Phoenix Client Embedded</name>
+ <description>Phoenix Client without logging implementation</description>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>embedded-shaded</id>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
+ <shadeTestJar>false</shadeTestJar>
+ <createSourcesJar>true</createSourcesJar>
+
<dependencyReducedPomLocation>${basedir}/target/pom.xml</dependencyReducedPomLocation>
+ <artifactSet>
+ <includes>
+ <include>*:*</include>
+ </includes>
+ <excludes>
+ <exclude>org.apache.phoenix:phoenix-client</exclude>
+ <exclude>xom:xom</exclude>
+ <exclude>org.slf4j:slf4j-log4j12</exclude>
+ </excludes>
+ </artifactSet>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/phoenix-client-parent/phoenix-client/pom.xml
b/phoenix-client-parent/phoenix-client/pom.xml
new file mode 100644
index 0000000..4781c3f
--- /dev/null
+++ b/phoenix-client-parent/phoenix-client/pom.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<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.apache.phoenix</groupId>
+ <artifactId>phoenix-client-parent</artifactId>
+ <version>5.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>phoenix-client</artifactId>
+ <name>Phoenix Client</name>
+ <description>Phoenix Client</description>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-shaded</id>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
+ <shadeTestJar>false</shadeTestJar>
+ <createSourcesJar>true</createSourcesJar>
+
<dependencyReducedPomLocation>${basedir}/target/pom.xml</dependencyReducedPomLocation>
+ <artifactSet>
+ <includes>
+ <include>*:*</include>
+ </includes>
+ <excludes>
+ <exclude>org.apache.phoenix:phoenix-client</exclude>
+ <exclude>xom:xom</exclude>
+ </excludes>
+ </artifactSet>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/phoenix-client/pom.xml b/phoenix-client-parent/pom.xml
similarity index 64%
rename from phoenix-client/pom.xml
rename to phoenix-client-parent/pom.xml
index f43c421..fd3cbd8 100644
--- a/phoenix-client/pom.xml
+++ b/phoenix-client-parent/pom.xml
@@ -24,10 +24,10 @@
<artifactId>phoenix</artifactId>
<version>5.1.0-SNAPSHOT</version>
</parent>
- <artifactId>phoenix-client</artifactId>
- <name>Phoenix Client</name>
- <description>Phoenix Client</description>
- <packaging>jar</packaging>
+ <artifactId>phoenix-client-parent</artifactId>
+ <name>Phoenix Client Parent</name>
+ <description>Common configuration for the Phoenix Client
Variants</description>
+ <packaging>pom</packaging>
<properties>
<!-- Don't make a test-jar -->
<maven.test.skip>true</maven.test.skip>
@@ -89,23 +89,20 @@
<exclude>org/apache/hadoop/yarn/factory/providers/package-info.class</exclude>
<exclude>org/apache/hadoop/yarn/client/api/impl/package-info.class</exclude>
<exclude>org/apache/hadoop/yarn/client/api/package-info.class</exclude>
- <exclude>webapps/*</exclude>
- <exclude>webapps/**/*</exclude>
+ <exclude>webapps/**</exclude>
</excludes>
</filter>
<!-- Phoenix specific -->
<filter>
<artifact>org.apache.commons:commons-math3</artifact>
<excludes>
- <exclude>assets/*</exclude>
- <exclude>assets/**/*</exclude>
+ <exclude>assets/**</exclude>
</excludes>
</filter>
<filter>
<artifact>org.apache.hbase:hbase-server</artifact>
<excludes>
- <exclude>hbase-webapps/*</exclude>
- <exclude>hbase-webapps/**/*</exclude>
+ <exclude>hbase-webapps/**</exclude>
</excludes>
</filter>
<!-- Phoenix specific -->
@@ -141,33 +138,23 @@
<pattern>org/</pattern>
<shadedPattern>${shaded.package}.org.</shadedPattern>
<excludes>
- <exclude>org/apache/hadoop/*</exclude>
- <exclude>org/apache/hadoop/**/*</exclude>
+ <exclude>org/apache/hadoop/**</exclude>
<!-- Our non-shaded htrace and logging libraries -->
- <exclude>org/apache/htrace/*</exclude>
- <exclude>org/apache/htrace/**/*</exclude>
- <exclude>org/slf4j/*</exclude>
- <exclude>org/slf4j/**/*</exclude>
- <exclude>org/apache/commons/logging/*</exclude>
- <exclude>org/apache/commons/logging/**/*</exclude>
- <exclude>org/apache/log4j/*</exclude>
- <exclude>org/apache/log4j/**/*</exclude>
- <exclude>**/pom.xml</exclude>
+ <exclude>org/apache/htrace/**</exclude>
+ <exclude>org/slf4j/**</exclude>
+ <exclude>org/apache/commons/logging/**</exclude>
+ <exclude>org/apache/log4j/**</exclude>
<!-- Not the org/ packages that are a part of the jdk -->
- <exclude>org/ietf/jgss/*</exclude>
- <exclude>org/omg/**/*</exclude>
- <exclude>org/w3c/dom/*</exclude>
- <exclude>org/w3c/dom/**/*</exclude>
- <exclude>org/xml/sax/*</exclude>
- <exclude>org/xml/sax/**/*</exclude>
+ <exclude>org/ietf/jgss/**</exclude>
+ <exclude>org/omg/**</exclude>
+ <exclude>org/w3c/dom/**</exclude>
+ <exclude>org/xml/sax/**</exclude>
<!-- Extras compared to Hadoop -->
<!-- Hbase classes - Maybe these could be shaded as well ? -->
- <exclude>org/apache/hbase/*</exclude>
- <exclude>org/apache/hbase/**/*</exclude>
+ <exclude>org/apache/hbase/**</exclude>
<!-- Phoenix classes -->
- <exclude>org/apache/phoenix/*</exclude>
- <exclude>org/apache/phoenix/**/*</exclude>
+ <exclude>org/apache/phoenix/**</exclude>
<!-- Do want/need to expose Omid and Tephra as well ? -->
</excludes>
</relocation>
@@ -175,33 +162,23 @@
<pattern>com/</pattern>
<shadedPattern>${shaded.package}.com.</shadedPattern>
<excludes>
- <exclude>**/pom.xml</exclude>
<!-- Not the com/ packages that are a part of particular jdk
implementations -->
- <exclude>com/sun/tools/*</exclude>
- <exclude>com/sun/javadoc/*</exclude>
- <exclude>com/sun/security/*</exclude>
- <exclude>com/sun/jndi/*</exclude>
- <exclude>com/sun/management/*</exclude>
- <exclude>com/sun/tools/**/*</exclude>
- <exclude>com/sun/javadoc/**/*</exclude>
- <exclude>com/sun/security/**/*</exclude>
- <exclude>com/sun/jndi/**/*</exclude>
- <exclude>com/sun/management/**/*</exclude>
+ <exclude>com/sun/tools/**</exclude>
+ <exclude>com/sun/javadoc/**</exclude>
+ <exclude>com/sun/security/**</exclude>
+ <exclude>com/sun/jndi/**</exclude>
+ <exclude>com/sun/management/**</exclude>
</excludes>
</relocation>
<relocation>
<pattern>io/</pattern>
<shadedPattern>${shaded.package}.io.</shadedPattern>
<excludes>
- <exclude>**/pom.xml</exclude>
<!-- Exclude config keys for Hadoop that look like package
names -->
- <exclude>io/compression/*</exclude>
- <exclude>io/compression/**/*</exclude>
- <exclude>io/mapfile/*</exclude>
- <exclude>io/mapfile/**/*</exclude>
+ <exclude>io/compression/**</exclude>
+ <exclude>io/mapfile/**</exclude>
<exclude>io/map/index/*</exclude>
- <exclude>io/seqfile/*</exclude>
- <exclude>io/seqfile/**/*</exclude>
+ <exclude>io/seqfile/**</exclude>
<exclude>io/file/buffer/size</exclude>
<exclude>io/skip/checksum/errors</exclude>
<exclude>io/sort/*</exclude>
@@ -212,39 +189,25 @@
<relocation>
<pattern>javax/el/</pattern>
<shadedPattern>${shaded.package}.javax.el.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<relocation>
<pattern>javax/cache/</pattern>
<shadedPattern>${shaded.package}.javax.cache.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<relocation>
<pattern>javax/servlet/</pattern>
<shadedPattern>${shaded.package}.javax.servlet.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<relocation>
<pattern>javax/ws/</pattern>
<shadedPattern>${shaded.package}.javax.ws.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<relocation>
<pattern>net/</pattern>
<shadedPattern>${shaded.package}.net.</shadedPattern>
<excludes>
- <exclude>**/pom.xml</exclude>
<!-- Exclude config keys for Hadoop that look like package
names -->
- <exclude>net/topology/*</exclude>
- <exclude>net/topology/**/*</exclude>
+ <exclude>net/topology/**</exclude>
</excludes>
</relocation>
<!-- okio declares a top level package instead of nested -->
@@ -257,102 +220,34 @@
<!-- Tephra -->
<pattern>co/</pattern>
<shadedPattern>${shaded.package}.co.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<relocation>
<pattern>it/</pattern>
<shadedPattern>${shaded.package}.it.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<relocation>
<pattern>javassist/</pattern>
<shadedPattern>${shaded.package}.javassist.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<relocation>
<pattern>jersey/</pattern>
<shadedPattern>${shaded.package}.jersey.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<relocation>
<pattern>jline/</pattern>
<shadedPattern>${shaded.package}.jline.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<relocation>
<pattern>mozilla/</pattern>
<shadedPattern>${shaded.package}.mozilla.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<relocation>
<pattern>tables/</pattern>
<shadedPattern>${shaded.package}.tables.</shadedPattern>
- <excludes>
- <exclude>**/pom.xml</exclude>
- </excludes>
</relocation>
<!-- Phoenix specific relocations end -->
</relocations>
</configuration>
- <executions>
- <execution>
- <id>default-shaded</id>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
-
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <shadeTestJar>false</shadeTestJar>
- <createSourcesJar>true</createSourcesJar>
-
<dependencyReducedPomLocation>${basedir}/target/pom.xml</dependencyReducedPomLocation>
- <artifactSet>
- <includes>
- <include>*:*</include>
- </includes>
- <excludes>
- <exclude>org.apache.phoenix:phoenix-client</exclude>
- <exclude>xom:xom</exclude>
- </excludes>
- </artifactSet>
- </configuration>
- </execution>
- <execution>
- <id>embedded-shaded</id>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <shadedArtifactAttached>true</shadedArtifactAttached>
- <shadedClassifierName>embedded</shadedClassifierName>
-
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <shadeTestJar>false</shadeTestJar>
- <artifactSet>
- <includes>
- <include>*:*</include>
- </includes>
- <excludes>
- <exclude>org.apache.phoenix:phoenix-client</exclude>
- <exclude>xom:xom</exclude>
- <exclude>org.slf4j:slf4j-log4j12</exclude>
- </excludes>
- </artifactSet>
- </configuration>
- </execution>
- </executions>
</plugin>
</plugins>
</build>
diff --git a/pom.xml b/pom.xml
index 40ec191..3b47243 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,8 @@
<module>phoenix-hbase-compat-2.1.6</module>
<module>phoenix-core</module>
<module>phoenix-pherf</module>
- <module>phoenix-client</module>
+ <module>phoenix-client-parent/phoenix-client</module>
+ <!-- phoenix-client-embedded is added in profile "embedded" -->
<module>phoenix-server</module>
<module>phoenix-assembly</module>
<module>phoenix-tools</module>
@@ -1647,6 +1648,17 @@
</build>
</profile>
<profile>
+ <id>embedded</id>
+ <activation>
+ <property>
+ <name>!skip.embedded</name>
+ </property>
+ </activation>
+ <modules>
+ <module>phoenix-client-parent/phoenix-client-embedded</module>
+ </modules>
+ </profile>
+ <profile>
<id>spotbugs-site</id>
<activation>
<property>