This is an automated email from the ASF dual-hosted git repository. michaelsmith pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit 87fd844d3ec8fd4665519497daf9a7f4cf148a53 Author: Michael Smith <[email protected]> AuthorDate: Fri Jun 30 11:28:11 2023 -0700 IMPALA-11941: (Addendum) Produce shaded copy of Jamm Produces a shaded copy of a pre-release jamm jar that supports Java 17. Building a copy of jamm and directly depending on it meant any consumer of Impala would have to provide their own build of it. Testing: ran custom_cluster/test_local_catalog.py with Java 8 and 17 Change-Id: Ida42d720a2639b65391c07a9237556311e04fac6 Reviewed-on: http://gerrit.cloudera.org:8080/20147 Reviewed-by: Michael Smith <[email protected]> Tested-by: Michael Smith <[email protected]> --- be/src/common/init.cc | 4 +- bin/run-all-tests.sh | 2 +- fe/pom.xml | 12 ++++-- java/pom.xml | 1 + java/shaded-deps/jamm/.gitignore | 1 + java/shaded-deps/jamm/pom.xml | 64 +++++++++++++++++++++++++++++ tests/verifiers/test_banned_log_messages.py | 3 ++ 7 files changed, 81 insertions(+), 6 deletions(-) diff --git a/be/src/common/init.cc b/be/src/common/init.cc index db76f46eb..86379cb15 100644 --- a/be/src/common/init.cc +++ b/be/src/common/init.cc @@ -351,11 +351,11 @@ static Status JavaAddJammAgent() { istringstream classpath {getenv("CLASSPATH")}; string jamm_path, test_path; while (getline(classpath, test_path, ':')) { - jamm_path = FileSystemUtil::FindFileInPath(test_path, "jamm-.*.jar"); + jamm_path = FileSystemUtil::FindFileInPath(test_path, "impala-jamm-.*.jar"); if (!jamm_path.empty()) break; } if (jamm_path.empty()) { - return Status("Could not find jamm-*.jar in Java CLASSPATH"); + return Status("Could not find impala-jamm-*.jar in Java CLASSPATH"); } val_out << "-javaagent:" << jamm_path; diff --git a/bin/run-all-tests.sh b/bin/run-all-tests.sh index 8f419c777..81be57ae0 100755 --- a/bin/run-all-tests.sh +++ b/bin/run-all-tests.sh @@ -245,7 +245,7 @@ do pushd "${IMPALA_FE_DIR}" # Add Jamm as javaagent for CatalogdMetaProviderTest.testWeights - JAMM_JAR=$(compgen -G ${IMPALA_HOME}/fe/target/dependency/jamm-*.jar) + JAMM_JAR=$(compgen -G ${IMPALA_HOME}/fe/target/dependency/impala-jamm-*.jar) export JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS-} -javaagent:${JAMM_JAR}" if $JAVA -version 2>&1 | grep -q -E ' version "(9|[1-9][0-9])\.'; then diff --git a/fe/pom.xml b/fe/pom.xml index bfa588176..3b9fd5fab 100644 --- a/fe/pom.xml +++ b/fe/pom.xml @@ -364,9 +364,15 @@ under the License. </dependency> <dependency> - <groupId>com.github.jbellis</groupId> - <artifactId>jamm</artifactId> - <version>0.4.0-IMPALA</version> + <groupId>org.apache.impala</groupId> + <artifactId>impala-jamm</artifactId> + <version>${project.version}</version> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> diff --git a/java/pom.xml b/java/pom.xml index 76364f06d..29a8a7c3b 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -370,6 +370,7 @@ under the License. <module>../fe</module> <module>query-event-hook-api</module> <module>shaded-deps/hive-exec</module> + <module>shaded-deps/jamm</module> <module>shaded-deps/s3a-aws-sdk</module> <module>TableFlattener</module> <module>test-hive-udfs</module> diff --git a/java/shaded-deps/jamm/.gitignore b/java/shaded-deps/jamm/.gitignore new file mode 100644 index 000000000..916e17c09 --- /dev/null +++ b/java/shaded-deps/jamm/.gitignore @@ -0,0 +1 @@ +dependency-reduced-pom.xml diff --git a/java/shaded-deps/jamm/pom.xml b/java/shaded-deps/jamm/pom.xml new file mode 100644 index 000000000..345b762a4 --- /dev/null +++ b/java/shaded-deps/jamm/pom.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed 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. See accompanying LICENSE file. +--> +<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"> + + <!-- This pom shades an unreleased version of jamm, as others need the JAR available to + use Impala jars. --> + <parent> + <groupId>org.apache.impala</groupId> + <artifactId>impala-parent</artifactId> + <version>4.3.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>impala-jamm</artifactId> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>com.github.jbellis</groupId> + <artifactId>jamm</artifactId> + <version>0.4.0-IMPALA</version> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <artifactId>maven-shade-plugin</artifactId> + <version>3.4.1</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <manifestEntries> + <Premain-Class>org.github.jamm.MemoryMeter</Premain-Class> + </manifestEntries> + </transformer> + </transformers> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/tests/verifiers/test_banned_log_messages.py b/tests/verifiers/test_banned_log_messages.py index 1f4d52162..627434139 100644 --- a/tests/verifiers/test_banned_log_messages.py +++ b/tests/verifiers/test_banned_log_messages.py @@ -33,6 +33,9 @@ class TestBannedLogMessages(ImpalaTestSuite): def assert_message_absent(self, message, log_dir=os.environ["IMPALA_LOGS_DIR"]): for root, _, files in os.walk(log_dir): for file in files: + if file == 'mvn.log': + # Skip mvn.log as some builds warn about extra shaded classes + continue log_file_path = os.path.join(root, file) returncode = subprocess.call(['grep', message, log_file_path]) assert returncode == 1, "%s contains '%s'" % (log_file_path, message)
