-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-6926. Add support for shaded protobufs used by hadoop-client/spark. #3915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,118 @@ | ||||||||||||||||||||||
| <?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||||||||||||||||||||
| <modelVersion>4.0.0</modelVersion> | ||||||||||||||||||||||
| <parent> | ||||||||||||||||||||||
| <groupId>org.apache.ozone</groupId> | ||||||||||||||||||||||
| <artifactId>ozone</artifactId> | ||||||||||||||||||||||
| <version>1.3.0-SNAPSHOT</version> | ||||||||||||||||||||||
| </parent> | ||||||||||||||||||||||
| <!-- | ||||||||||||||||||||||
| This is called "ozone-filesystem-hadoop3-client" to correspond with | ||||||||||||||||||||||
| the shaded hadoop jar that it works with: | ||||||||||||||||||||||
| "hadoop-client-api.jar", (as opposed to the unshaded hadoop jar: | ||||||||||||||||||||||
| "hadoop-common.jar") | ||||||||||||||||||||||
| --> | ||||||||||||||||||||||
| <artifactId>ozone-filesystem-hadoop3-client</artifactId> | ||||||||||||||||||||||
| <name>Apache Ozone FS Hadoop shaded 3.x compatibility</name> | ||||||||||||||||||||||
| <packaging>jar</packaging> | ||||||||||||||||||||||
| <version>1.3.0-SNAPSHOT</version> | ||||||||||||||||||||||
| <dependencies> | ||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||
| <groupId>org.apache.ozone</groupId> | ||||||||||||||||||||||
| <artifactId>ozone-filesystem-hadoop3</artifactId> | ||||||||||||||||||||||
| <optional>true</optional> | ||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||
| </dependencies> | ||||||||||||||||||||||
| <build> | ||||||||||||||||||||||
| <plugins> | ||||||||||||||||||||||
| <plugin> | ||||||||||||||||||||||
| <groupId>org.apache.maven.plugins</groupId> | ||||||||||||||||||||||
| <artifactId>maven-dependency-plugin</artifactId> | ||||||||||||||||||||||
| <executions> | ||||||||||||||||||||||
| <execution> | ||||||||||||||||||||||
| <id>include-dependencies</id> | ||||||||||||||||||||||
| <phase>prepare-package</phase> | ||||||||||||||||||||||
| <goals> | ||||||||||||||||||||||
| <goal>unpack</goal> | ||||||||||||||||||||||
| </goals> | ||||||||||||||||||||||
| <configuration> | ||||||||||||||||||||||
| <excludes>META-INF/versions/**/*.*</excludes> | ||||||||||||||||||||||
| <artifactItems> | ||||||||||||||||||||||
| <artifactItem> | ||||||||||||||||||||||
| <groupId>org.apache.ozone</groupId> | ||||||||||||||||||||||
| <artifactId>ozone-filesystem-shaded</artifactId> | ||||||||||||||||||||||
| <version>${project.version}</version> | ||||||||||||||||||||||
| </artifactItem> | ||||||||||||||||||||||
| </artifactItems> | ||||||||||||||||||||||
| <outputDirectory>target/classes</outputDirectory> | ||||||||||||||||||||||
| </configuration> | ||||||||||||||||||||||
| </execution> | ||||||||||||||||||||||
| </executions> | ||||||||||||||||||||||
| </plugin> | ||||||||||||||||||||||
| <plugin> | ||||||||||||||||||||||
| <groupId>org.apache.maven.plugins</groupId> | ||||||||||||||||||||||
| <artifactId>maven-shade-plugin</artifactId> | ||||||||||||||||||||||
| <executions> | ||||||||||||||||||||||
| <execution> | ||||||||||||||||||||||
| <phase>package</phase> | ||||||||||||||||||||||
| <goals> | ||||||||||||||||||||||
| <goal>shade</goal> | ||||||||||||||||||||||
| </goals> | ||||||||||||||||||||||
| <configuration> | ||||||||||||||||||||||
| <transformers> | ||||||||||||||||||||||
| <transformer | ||||||||||||||||||||||
| implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer"> | ||||||||||||||||||||||
| <resources> | ||||||||||||||||||||||
| <resource>META-INF/BC1024KE.DSA</resource> | ||||||||||||||||||||||
| <resource>META-INF/BC2048KE.DSA</resource> | ||||||||||||||||||||||
| <resource>META-INF/BC1024KE.SF</resource> | ||||||||||||||||||||||
| <resource>META-INF/BC2048KE.SF</resource> | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just curious~ what do BC1024KE.DSA and BC2048KE.SF mean?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding is that is used when shading jars to prevent the changes from causing security exceptions. We use it here as well: ozone/hadoop-ozone/ozonefs-shaded/pom.xml Lines 94 to 103 in 48e3b49
That is where I got it from.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ohh!! thanks!! |
||||||||||||||||||||||
| </resources> | ||||||||||||||||||||||
| </transformer> | ||||||||||||||||||||||
| <transformer | ||||||||||||||||||||||
| implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> | ||||||||||||||||||||||
| <transformer | ||||||||||||||||||||||
| implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer"> | ||||||||||||||||||||||
| <resource>ozone-default-generated.xml</resource> | ||||||||||||||||||||||
| </transformer> | ||||||||||||||||||||||
| </transformers> | ||||||||||||||||||||||
| <relocations> | ||||||||||||||||||||||
| <relocation> | ||||||||||||||||||||||
| <pattern>com.google.protobuf</pattern> | ||||||||||||||||||||||
| <shadedPattern> | ||||||||||||||||||||||
| org.apache.hadoop.shaded.com.google.protobuf | ||||||||||||||||||||||
| </shadedPattern> | ||||||||||||||||||||||
| <includes> | ||||||||||||||||||||||
| <include>com.google.protobuf.*</include> | ||||||||||||||||||||||
| </includes> | ||||||||||||||||||||||
| </relocation> | ||||||||||||||||||||||
| </relocations> | ||||||||||||||||||||||
| </configuration> | ||||||||||||||||||||||
| </execution> | ||||||||||||||||||||||
| </executions> | ||||||||||||||||||||||
| </plugin> | ||||||||||||||||||||||
| <plugin> | ||||||||||||||||||||||
| <groupId>com.github.spotbugs</groupId> | ||||||||||||||||||||||
| <artifactId>spotbugs-maven-plugin</artifactId> | ||||||||||||||||||||||
| <configuration> | ||||||||||||||||||||||
| <onlyAnalyze>org.apache.hadoop.fs.ozone.*</onlyAnalyze> | ||||||||||||||||||||||
| </configuration> | ||||||||||||||||||||||
| </plugin> | ||||||||||||||||||||||
| </plugins> | ||||||||||||||||||||||
| </build> | ||||||||||||||||||||||
| </project> | ||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the documentation for why the name was selected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kerneltime Done. Please cherry-pick into the 1.3 branch when you can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious~ how to know which jar is shaded and which isn't?
are they documented somewhere~?