This is an automated email from the ASF dual-hosted git repository. stoty pushed a commit to branch 4.x in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x by this push: new cc39ea1 PHOENIX-6114 Create shaded phoenix-pherf and remove lib dir from assembly cc39ea1 is described below commit cc39ea1a207745084cb8e7931e0231d97f5ba00a Author: Istvan Toth <st...@apache.org> AuthorDate: Thu Feb 4 09:15:54 2021 +0100 PHOENIX-6114 Create shaded phoenix-pherf and remove lib dir from assembly remove pherf-cluster.py remove phoenix-pherf-minimal shaded jar remove /lib dir from assembly remove /dev library from assemby shade phoenix-pherf instead move phoenix-pherf.jar to root update scripts for new jar names and paths --- bin/pherf-cluster.py | 84 -------- bin/phoenix_utils.py | 2 +- .../build/components/all-common-dependencies.xml | 96 --------- .../src/build/components/all-common-files.xml | 14 -- .../src/build/components/all-common-jars.xml | 20 +- phoenix-assembly/src/build/package-to-tar-all.xml | 15 -- phoenix-pherf/pom.xml | 229 +-------------------- 7 files changed, 6 insertions(+), 454 deletions(-) diff --git a/bin/pherf-cluster.py b/bin/pherf-cluster.py deleted file mode 100755 index 4c688f9..0000000 --- a/bin/pherf-cluster.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python -############################################################################ -# -# 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. -# -############################################################################ - -# This script is intended for use where HBase/Phoenix is loaded from HBase classpath -# therefore HBASE_DIR environment variable needs to be configured for this script to execute - -from __future__ import print_function -from phoenix_utils import tryDecode -import os -import subprocess -import sys -import phoenix_utils - -phoenix_utils.setPath() - -args = phoenix_utils.shell_quote(sys.argv[1:]) - -# HBase configuration folder path (where hbase-site.xml reside) for -# HBase/Phoenix client side property override -hbase_config_path = os.getenv('HBASE_CONF_DIR', phoenix_utils.current_dir) -hbase_path = os.getenv('HBASE_DIR') - -java_home = os.getenv('JAVA_HOME') - -# load hbase-env.??? to extract JAVA_HOME, HBASE_PID_DIR, HBASE_LOG_DIR -hbase_env_path = None -hbase_env_cmd = None -if os.name == 'posix': - hbase_env_path = os.path.join(hbase_config_path, 'hbase-env.sh') - hbase_env_cmd = ['bash', '-c', 'source %s && env' % hbase_env_path] -elif os.name == 'nt': - hbase_env_path = os.path.join(hbase_config_path, 'hbase-env.cmd') - hbase_env_cmd = ['cmd.exe', '/c', 'call %s & set' % hbase_env_path] -if not hbase_env_path or not hbase_env_cmd: - sys.stderr.write("hbase-env file unknown on platform {}{}".format(os.name, os.linesep)) - sys.exit(-1) - -hbase_env = {} -if os.path.isfile(hbase_env_path): - p = subprocess.Popen(hbase_env_cmd, stdout = subprocess.PIPE) - for x in p.stdout: - (k, _, v) = tryDecode(x).partition('=') - hbase_env[k.strip()] = v.strip() - -if 'JAVA_HOME' in hbase_env: - java_home = hbase_env['JAVA_HOME'] - -if java_home: - java = os.path.join(java_home, 'bin', 'java') -else: - java = 'java' - -print("HBASE_DIR environment variable is currently set to: " + hbase_path) - -# Get the HBase classpath -hbasecp, stderr = subprocess.Popen(hbase_path + "/bin/hbase classpath", - shell=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE).communicate() - -java_cmd = java +' -cp "' + tryDecode(hbasecp) + os.pathsep + phoenix_utils.pherf_conf_path + os.pathsep + phoenix_utils.hbase_conf_dir + os.pathsep + phoenix_utils.phoenix_pherf_jar + \ - '" -Dlog4j.configuration=file:' + \ - os.path.join(phoenix_utils.current_dir, "log4j.properties") + \ - " org.apache.phoenix.pherf.Pherf " + args - -os.execl("/bin/sh", "/bin/sh", "-c", java_cmd) diff --git a/bin/phoenix_utils.py b/bin/phoenix_utils.py index 84f228d..126139d 100755 --- a/bin/phoenix_utils.py +++ b/bin/phoenix_utils.py @@ -80,7 +80,7 @@ def setPath(): PHOENIX_CLIENT_JAR_PATTERN = "phoenix-client-hbase-*[!s].jar" PHOENIX_TRACESERVER_JAR_PATTERN = "phoenix-tracing-webapp-*-runnable.jar" PHOENIX_TESTS_JAR_PATTERN = "phoenix-core-*-tests*.jar" - PHOENIX_PHERF_JAR_PATTERN = "phoenix-pherf-*-minimal*.jar" + PHOENIX_PHERF_JAR_PATTERN = "phoenix-pherf-*[!s].jar" # Backward support old env variable PHOENIX_LIB_DIR replaced by PHOENIX_CLASS_PATH global phoenix_class_path diff --git a/phoenix-assembly/src/build/components/all-common-dependencies.xml b/phoenix-assembly/src/build/components/all-common-dependencies.xml deleted file mode 100644 index 094c967..0000000 --- a/phoenix-assembly/src/build/components/all-common-dependencies.xml +++ /dev/null @@ -1,96 +0,0 @@ -<?xml version='1.0'?> -<!-- - - 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. - ---> -<component> - <!-- All of our dependencies --> - <dependencySets> - <dependencySet> - <!-- Unpack all the dependencies to class files, since java doesn't support - jar of jars for running --> - <unpack>false</unpack> - <outputDirectory>/lib</outputDirectory> - <includes> - <include>org.apache.phoenix:phoenix-hbase-compat-${hbase.compat.version}</include> - - <include>commons-configuration:commons-configuration</include> - <include>commons-io:commons-io</include> - <include>commons-lang:commons-lang</include> - <include>commons-logging:commons-logging</include> - <include>org.apache.commons:commons-csv</include> - <include>com.google.guava:guava</include> - <include>org.apache.hadoop:hadoop*</include> - <include>com.google.protobuf:protobuf-java</include> - <include>org.slf4j:slf4j-api</include> - <include>org.apache.zookeeper:zookeeper</include> - <include>org.apache.curator:curator-framework</include> - <include>org.apache.curator:curator-client</include> - <include>log4j:log4j</include> - <include>org.apache.hbase:hbase*</include> - <include>org.antlr:antlr-runtime</include> - <include>org.cloudera.htrace:htrace-core</include> - <include>io.netty:netty</include> - <include>commons-codec:commons-codec</include> - <include>org.apache.calcite:calcite-avatica*</include> - - <!-- For omid TSO --> - <include>org.apache.omid:omid-tso-server-hbase1.x</include> - <include>org.apache.omid:omid-hbase-common-hbase1.x</include> - <include>org.apache.omid:omid-hbase-tools-hbase1.x</include> - <include>org.apache.omid:omid-common</include> - <include>org.apache.omid:omid-metrics</include> - <include>org.apache.omid:omid-timestamp-storage-hbase1.x</include> - <include>org.apache.omid:omid-hbase-shims-hbase1.x</include> - <include>org.apache.omid:omid-commit-table</include> - <include>org.apache.omid:omid-codahale-metrics</include> - <include>org.apache.omid:omid-hbase-commit-table-hbase1.x</include> - <include>org.yaml:snakeyaml</include> - <include>com.google.inject:guice</include> - <include>commons-beanutils:commons-beanutils</include> - <include>javax.inject:javax.inject</include> - <include>aopalliance:aopalliance</include> - <include>org.apache.commons:commons-pool2</include> - <include>com.lmax:disruptor</include> - <include>com.codahale.metrics:metrics-core</include> - <include>com.beust:jcommander</include> - <include>commons-collections:commons-collections</include> - <include>io.netty:netty-all</include> - <include>org.apache.htrace:htrace-core</include> - <include>javax.servlet:javax.servlet-api</include> - <include>commons-cli:commons-cli</include> - <include>com.yammer.metrics:metrics-core</include> - <include>com.codahale.metrics:metrics-graphite</include> - </includes> - </dependencySet> - <!-- Separate dependency set to just pull in the jackson stuff since its test - scoped and we only include 'runtime' scoped (which includes compile) dependencies --> - <dependencySet> - <unpack>false</unpack> - <scope>test</scope> - <!-- save these dependencies to the top-level --> - <outputDirectory>/lib</outputDirectory> - <includes> - <include>com.fasterxml.jackson.core:jackson-core</include> - <include>com.fasterxml.jackson.core:jackson-databind</include> - <include>com.fasterxml.jackson.core:jackson-annotations</include> - </includes> - </dependencySet> - </dependencySets> -</component> diff --git a/phoenix-assembly/src/build/components/all-common-files.xml b/phoenix-assembly/src/build/components/all-common-files.xml index f4c4c30..25f461b 100644 --- a/phoenix-assembly/src/build/components/all-common-files.xml +++ b/phoenix-assembly/src/build/components/all-common-files.xml @@ -70,11 +70,6 @@ </excludes> </fileSet> <fileSet> - <directory>${project.basedir}/../dev</directory> - <fileMode>0644</fileMode> - <directoryMode>0755</directoryMode> - </fileSet> - <fileSet> <directory>${project.basedir}/../docs</directory> <fileMode>0644</fileMode> <directoryMode>0755</directoryMode> @@ -84,14 +79,5 @@ <fileMode>0644</fileMode> <directoryMode>0755</directoryMode> </fileSet> - <fileSet> - <directory>${project.basedir}/../phoenix-pherf/target</directory> - <outputDirectory>phoenix-pherf</outputDirectory> - <includes> - <include>*.zip</include> - </includes> - <fileMode>0644</fileMode> - <directoryMode>0755</directoryMode> - </fileSet> </fileSets> </component> diff --git a/phoenix-assembly/src/build/components/all-common-jars.xml b/phoenix-assembly/src/build/components/all-common-jars.xml index ea5232b..a7b3a34 100644 --- a/phoenix-assembly/src/build/components/all-common-jars.xml +++ b/phoenix-assembly/src/build/components/all-common-jars.xml @@ -37,26 +37,12 @@ <include>phoenix-server-${hbase.suffix}-${project.version}.jar</include> </includes> </fileSet> - - <!-- This is only necessary until maven fixes the intra-project dependency bug - in maven 3.0. Until then, we have to include the jars for sub-projects explicitly. - Otherwise, test jars are pulled in wrongly. - --> - <fileSet> - <directory>${project.basedir}/../phoenix-core/target/</directory> - <outputDirectory>lib</outputDirectory> - <includes> - <include>phoenix-*.jar</include> - </includes> - <fileMode>0644</fileMode> - </fileSet> <fileSet> - <directory>${project.basedir}/../phoenix-pherf/target/</directory> - <outputDirectory>lib</outputDirectory> + <directory>${project.basedir}/../phoenix-pherf/target</directory> + <outputDirectory>/</outputDirectory> <includes> - <include>phoenix-*.jar</include> + <include>phoenix-pherf-${project.version}.jar</include> </includes> - <fileMode>0644</fileMode> </fileSet> </fileSets> </component> diff --git a/phoenix-assembly/src/build/package-to-tar-all.xml b/phoenix-assembly/src/build/package-to-tar-all.xml index 519599b..fa945f8 100644 --- a/phoenix-assembly/src/build/package-to-tar-all.xml +++ b/phoenix-assembly/src/build/package-to-tar-all.xml @@ -30,23 +30,8 @@ </formats> <includeBaseDirectory>true</includeBaseDirectory> - <!-- Components that we don't want in jars that are used with other libraries, but we want for a standalone client --> - <dependencySets> - <dependencySet> - <!-- Unpack all the dependencies to class files, since java doesn't support - jar of jars for running --> - <unpack>false</unpack> - <!-- save these dependencies to the top-level --> - <outputDirectory>/lib</outputDirectory> - <includes> - <include>org.slf4j:slf4j-log4j12</include> - </includes> - </dependencySet> - </dependencySets> - <componentDescriptors> <componentDescriptor>src/build/components/all-common-jars.xml</componentDescriptor> <componentDescriptor>src/build/components/all-common-files.xml</componentDescriptor> - <componentDescriptor>src/build/components/all-common-dependencies.xml</componentDescriptor> </componentDescriptors> </assembly> \ No newline at end of file diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml index 28ee6fa..46b3461 100644 --- a/phoenix-pherf/pom.xml +++ b/phoenix-pherf/pom.xml @@ -181,25 +181,6 @@ </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>install-file</goal> - </goals> - <id>default-install</id> - <configuration> - <skip>true</skip> - </configuration> - <phase>install</phase> - </execution> - </executions> - <configuration> - <file>${basedir}/target/phoenix-pherf-${project.version}-minimal.jar</file> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> @@ -208,9 +189,7 @@ <goal>shade</goal> </goals> <configuration> - <finalName>phoenix-pherf-${project.version}-minimal</finalName> - <shadedArtifactAttached>false</shadedArtifactAttached> - <promoteTransitiveDependencies>true</promoteTransitiveDependencies> + <promoteTransitiveDependencies>false</promoteTransitiveDependencies> <shadeTestJar>false</shadeTestJar> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> @@ -233,6 +212,7 @@ <artifactSet> <includes> <include>org.apache.phoenix:phoenix-pherf</include> + <include>com.google.guava:guava</include> <include>com.googlecode.java-diff-utils:diffutils</include> <include>org.apache.commons:commons-lang3</include> <include>org.apache.commons:commons-math3</include> @@ -255,211 +235,6 @@ </excludes> </filter> </filters> - - <relocations> - - <!-- COM relocation --> - <relocation> - <pattern>com.codahale</pattern> - <shadedPattern>${shaded.package}.com.codahale</shadedPattern> - </relocation> - <relocation> - <pattern>com.fasterxml</pattern> - <shadedPattern>${shaded.package}.com.fasterxml</shadedPattern> - </relocation> - <relocation> - <pattern>com.jamesmurty</pattern> - <shadedPattern>${shaded.package}.com.jamesmurty</shadedPattern> - </relocation> - <relocation> - <pattern>com.jcraft</pattern> - <shadedPattern>${shaded.package}.com.jcraft</shadedPattern> - </relocation> - <relocation> - <pattern>com.lmax</pattern> - <shadedPattern>${shaded.package}.com.lmax</shadedPattern> - </relocation> - <relocation> - <pattern>com.thoughtworks</pattern> - <shadedPattern>${shaded.package}.com.thoughtworks</shadedPattern> - </relocation> - <relocation> - <pattern>com.yammer</pattern> - <shadedPattern>${shaded.package}.com.yammer</shadedPattern> - </relocation> - - <!-- IO relocations --> - <relocation> - <pattern>io.netty</pattern> - <shadedPattern>${shaded.package}.io.netty</shadedPattern> - </relocation> - - <!-- ORG relocations --> - <relocation> - <pattern>org.antlr</pattern> - <shadedPattern>${shaded.package}.org.antlr</shadedPattern> - </relocation> - <relocation> - <pattern>org.aopalliance</pattern> - <shadedPattern>${shaded.package}.org.aopalliance</shadedPattern> - </relocation> - <relocation> - <pattern>org.codehaus</pattern> - <shadedPattern>${shaded.package}.org.codehaus</shadedPattern> - </relocation> - <relocation> - <pattern>org.fusesource</pattern> - <shadedPattern>${shaded.package}.org.fusesource</shadedPattern> - </relocation> - <relocation> - <pattern>org.hamcrest</pattern> - <shadedPattern>${shaded.package}.org.hamcrest</shadedPattern> - </relocation> - <relocation> - <pattern>org.hsqldb</pattern> - <shadedPattern>${shaded.package}.org.hsqldb</shadedPattern> - </relocation> - <relocation> - <pattern>org.iq80</pattern> - <shadedPattern>${shaded.package}.org.iq80</shadedPattern> - </relocation> - <relocation> - <pattern>org.jamon</pattern> - <shadedPattern>${shaded.package}.org.jamon</shadedPattern> - </relocation> - <relocation> - <pattern>org.jboss</pattern> - <shadedPattern>${shaded.package}.org.jboss</shadedPattern> - </relocation> - <relocation> - <pattern>org.jcodings</pattern> - <shadedPattern>${shaded.package}.org.jcodings</shadedPattern> - </relocation> - <relocation> - <pattern>org.jets3t</pattern> - <shadedPattern>${shaded.package}.org.jets3t</shadedPattern> - </relocation> - <relocation> - <pattern>org.joda</pattern> - <shadedPattern>${shaded.package}.org.joda</shadedPattern> - </relocation> - <relocation> - <pattern>org.joni</pattern> - <shadedPattern>${shaded.package}.org.joni</shadedPattern> - </relocation> - <relocation> - <pattern>org.junit</pattern> - <shadedPattern>${shaded.package}.org.junit</shadedPattern> - </relocation> - <relocation> - <pattern>org.kosmix</pattern> - <shadedPattern>${shaded.package}.org.kosmix</shadedPattern> - </relocation> - <relocation> - <pattern>org.mortbay</pattern> - <shadedPattern>${shaded.package}.org.mortbay</shadedPattern> - </relocation> - <relocation> - <pattern>org.objectweb</pattern> - <shadedPattern>${shaded.package}.org.objectweb</shadedPattern> - </relocation> - <relocation> - <pattern>org.stringtemplate</pattern> - <shadedPattern>${shaded.package}.org.stringtemplate</shadedPattern> - </relocation> - <relocation> - <pattern>org.tukaani</pattern> - <shadedPattern>${shaded.package}.org.tukaani</shadedPattern> - </relocation> - <relocation> - <pattern>org.znerd</pattern> - <shadedPattern>${shaded.package}.org.znerd</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.avro</pattern> - <shadedPattern>${shaded.package}.org.apache.avro</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.commons</pattern> - <shadedPattern>${shaded.package}.org.apache.commons</shadedPattern> - <excludes> - <exclude>org.apache.commons.csv.**</exclude> - <exclude>org.apache.commons.logging.**</exclude> - </excludes> - </relocation> - <relocation> - <pattern>org.apache.directory</pattern> - <shadedPattern>${shaded.package}.org.apache.directory</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.http</pattern> - <shadedPattern>${shaded.package}.org.apache.http</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.jasper</pattern> - <shadedPattern>${shaded.package}.org.apache.jasper</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.jute</pattern> - <shadedPattern>${shaded.package}.org.apache.jute</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.mina</pattern> - <shadedPattern>${shaded.package}.org.apache.mina</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.oro</pattern> - <shadedPattern>${shaded.package}.org.apache.oro</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.taglibs</pattern> - <shadedPattern>${shaded.package}.org.apache.taglibs</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.thrift</pattern> - <shadedPattern>${shaded.package}.org.apache.thrift</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.tools</pattern> - <shadedPattern>${shaded.package}.org.apache.tools</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.twill</pattern> - <shadedPattern>${shaded.package}.org.apache.twill</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.velocity</pattern> - <shadedPattern>${shaded.package}.org.apache.velocity</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.zookeeper</pattern> - <shadedPattern>${shaded.package}.org.apache.zookeeper</shadedPattern> - </relocation> - - <!-- NET relocations --> - <relocation> - <pattern>net</pattern> - <shadedPattern>${shaded.package}.net</shadedPattern> - </relocation> - - <!-- Misc relocations --> - <relocation> - <pattern>antlr</pattern> - <shadedPattern>${shaded.package}.antlr</shadedPattern> - </relocation> - <relocation> - <pattern>it.unimi</pattern> - <shadedPattern>${shaded.package}.it.unimi</shadedPattern> - </relocation> - <relocation> - <pattern>jline</pattern> - <shadedPattern>${shaded.package}.jline</shadedPattern> - </relocation> - <relocation> - <pattern>junit</pattern> - <shadedPattern>${shaded.package}.junit</shadedPattern> - </relocation> - </relocations> </configuration> </execution> </executions>