hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [3/3] hbase-thirdparty git commit: Add a netty module; it has enough idiosynchracies to justify special treatment
Date Thu, 29 Jun 2017 18:39:49 GMT
Add a netty module; it has enough idiosynchracies to justify special treatment


Project: http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/commit/e7f8d0d0
Tree: http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/tree/e7f8d0d0
Diff: http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/diff/e7f8d0d0

Branch: refs/heads/master
Commit: e7f8d0d05a926b4d0117e772f309d4031b84d0c3
Parents: 1ad82e3
Author: Michael Stack <stack@apache.org>
Authored: Thu Jun 29 11:39:35 2017 -0700
Committer: Michael Stack <stack@apache.org>
Committed: Thu Jun 29 11:39:35 2017 -0700

----------------------------------------------------------------------
 README.txt                         |   6 +-
 hbase-shaded-miscellaneous/pom.xml | 113 ++++++++++++++++++++++
 hbase-shaded-netty/pom.xml         | 145 ++++++++++++++++++++++++++++
 hbase-shaded-thirdparty/pom.xml    | 166 --------------------------------
 pom.xml                            |   3 +-
 src/main/assembly/src.xml          |   3 +-
 6 files changed, 265 insertions(+), 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/blob/e7f8d0d0/README.txt
----------------------------------------------------------------------
diff --git a/README.txt b/README.txt
index 474f912..28b554a 100644
--- a/README.txt
+++ b/README.txt
@@ -19,9 +19,9 @@ To build a src tarball:
 (Make sure you have your credentials set over in ~/.m2/settings.xml, etc. -- see
 hbase refguide for publishing SNAPSHOTS/Release Candidates)
 
-We have two submodules, one to patch and then relocate (shade) protobuf. The other
-modules relocate a bundle of other (unpatched) libs used by hbase. This latter
-set includes protobuf-util, netty-all, gson, and guava.
+We have a number of submodules, one per ornery lib -- protobuf and netty --
+where we need special-handling and then a bucket for all the rest,
+hbase-shaded-miscellaneous. This latter includes protobuf-util, gson, and guava.
 
 All shading is done using the same relocation offset of
 org.apache.hadoop.hbase.shaded; we add this prefix to the relocated thirdparty

http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/blob/e7f8d0d0/hbase-shaded-miscellaneous/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shaded-miscellaneous/pom.xml b/hbase-shaded-miscellaneous/pom.xml
new file mode 100644
index 0000000..c8adf84
--- /dev/null
+++ b/hbase-shaded-miscellaneous/pom.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd">
+  <!--
+/**
+ * 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.
+ */
+
+
+  ON MVN COMPILE NOT WORKING
+
+  If you wondering why 'mvn compile' does not work building HBase
+  (in particular, if you are doing it for the first time), instead do
+  'mvn package'.  If you are interested in the full story, see
+  https://issues.apache.org/jira/browse/HBASE-6795.
+
+-->
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.hbase.thirdparty</groupId>
+    <artifactId>hbase-thirdparty</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+  <artifactId>hbase-shaded-miscellaneous</artifactId>
+  <name>Apache HBase Relocated (Shaded) Third-party Miscellaneous Libs</name>
+  <description>
+    Pulls down a set of libs, relocates them and then makes a fat new jar with them all in
it.
+    See below for what this miscellaney includes.
+  </description>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-clean-plugin</artifactId>
+        <configuration>
+          <filesets>
+            <fileset>
+              <directory>${basedir}</directory>
+              <includes>
+                <include>dependency-reduced-pom.xml</include>
+              </includes>
+            </fileset>
+          </filesets>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <relocations>
+                <relocation>
+                  <pattern>com.google</pattern>
+                  <shadedPattern>${rename.offset}.com.google</shadedPattern>
+                </relocation>
+              </relocations>
+              <artifactSet>
+                <excludes>
+                  <!--Exclude protobuf itself. We get a patched version in adjacent module.
+                        Exclude other dependencies of guava, netty, etc.
+                    -->
+                  <exclude>com.google.protobuf:protobuf-java</exclude>
+                  <exclude>com.google.code.findbugs:jsr305</exclude>
+                  <exclude>com.google.errorprone:error_prone_annotations</exclude>
+                  <exclude>com.google.j2objc:j2objc-annotations</exclude>
+                  <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
+                  <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
+                </excludes>
+              </artifactSet>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>com.google.code.gson</groupId>
+      <artifactId>gson</artifactId>
+      <version>2.8.1</version>
+    </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>22.0</version>
+    </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java-util</artifactId>
+      <!--Version should be same as protobuf except sometimes
+           they publish new protobuf version w/o updating util.-->
+      <version>3.3.0</version>
+    </dependency>
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/blob/e7f8d0d0/hbase-shaded-netty/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shaded-netty/pom.xml b/hbase-shaded-netty/pom.xml
new file mode 100644
index 0000000..4e5ac42
--- /dev/null
+++ b/hbase-shaded-netty/pom.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd">
+  <!--
+/**
+ * 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.
+ */
+
+
+  ON MVN COMPILE NOT WORKING
+
+  If you wondering why 'mvn compile' does not work building HBase
+  (in particular, if you are doing it for the first time), instead do
+  'mvn package'.  If you are interested in the full story, see
+  https://issues.apache.org/jira/browse/HBASE-6795.
+
+-->
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.hbase.thirdparty</groupId>
+    <artifactId>hbase-thirdparty</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+  <artifactId>hbase-shaded-netty</artifactId>
+  <name>Apache HBase Relocated (Shaded) Netty Libs</name>
+  <description>
+    Pulls down netty.io, relocates nd then makes a fat new jar with them all in it.
+  </description>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-clean-plugin</artifactId>
+        <configuration>
+          <filesets>
+            <fileset>
+              <directory>${basedir}</directory>
+              <includes>
+                <include>dependency-reduced-pom.xml</include>
+              </includes>
+            </fileset>
+          </filesets>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <relocations>
+                <relocation>
+                  <pattern>io.netty</pattern>
+                  <shadedPattern>${rename.offset}.io.netty</shadedPattern>
+                </relocation>
+              </relocations>
+              <artifactSet>
+                <excludes>
+                  <!--Exclude protobuf itself. We get a patched version in adjacent module.
+                        Exclude other dependencies of guava, netty, etc.
+                    -->
+                  <exclude>com.google.protobuf:protobuf-java</exclude>
+                  <exclude>com.google.code.findbugs:jsr305</exclude>
+                  <exclude>com.google.errorprone:error_prone_annotations</exclude>
+                  <exclude>com.google.j2objc:j2objc-annotations</exclude>
+                  <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
+                  <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
+                </excludes>
+              </artifactSet>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <!--This trick from
+             https://stackoverflow.com/questions/33825743/rename-files-inside-a-jar-using-some-maven-plugin
+
+            The netty jar has a .so in it. Shading requires rename of the .so and then passing
a system
+            property so netty finds the renamed .so and associates it w/ the relocated netty
files.
+
+            Add this define when running unit tests:
+            
+               mvn test -Dorg.apache.hadoop.hbase.shaded.io.netty.packagePrefix=org.apache.hadoop.hbase.shaded.
-Dtest=TestNettyIPC
+
+            See toward the end of this issue for how to pass config:
+            
+              https://github.com/netty/netty/issues/6665
+
+            TODO: Ensure native works.
+            NOTE: The 'tofile' in the move command below has the relocation hard-coded
+            with '-' instead of '.' separators. If change the relocation, need to change
here too.
+          -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.8</version>
+        <executions>
+          <execution>
+            <id>unpack</id>
+            <phase>package</phase>
+            <configuration>
+              <target>
+                <echo message="unjar"/>
+                <unzip src="${project.build.directory}/${project.artifactId}-${project.version}.jar"
+                  dest="${project.build.directory}/unpacked/"/>
+                <echo message="Rename netty .so in META-INF"/>
+                <move file="${project.build.directory}/unpacked/META-INF/native/libnetty-transport-native-epoll.so"
+                  tofile="${project.build.directory}/unpacked/META-INF/native/liborg-apache-hadoop-hbase-shaded-netty-transport-native-epoll.so"
/>
+                <echo message="Redo jar"/>
+                <jar destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar"
+                    basedir="${project.build.directory}/unpacked"/>
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-all</artifactId>
+      <version>4.1.12.Final</version>
+    </dependency>
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/blob/e7f8d0d0/hbase-shaded-thirdparty/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-shaded-thirdparty/pom.xml b/hbase-shaded-thirdparty/pom.xml
deleted file mode 100644
index 51950fa..0000000
--- a/hbase-shaded-thirdparty/pom.xml
+++ /dev/null
@@ -1,166 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
-  <!--
-/**
- * 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.
- */
-
-
-  ON MVN COMPILE NOT WORKING
-
-  If you wondering why 'mvn compile' does not work building HBase
-  (in particular, if you are doing it for the first time), instead do
-  'mvn package'.  If you are interested in the full story, see
-  https://issues.apache.org/jira/browse/HBASE-6795.
-
--->
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.apache.hbase.thirdparty</groupId>
-    <artifactId>hbase-thirdparty</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <relativePath>..</relativePath>
-  </parent>
-  <artifactId>hbase-shaded-thirdparty</artifactId>
-  <name>Apache HBase Relocated (Shaded) Third-party Libs</name>
-  <description>
-    Pulls down libs, relocates them and then makes a fat new jar with them all in it.
-  </description>
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-clean-plugin</artifactId>
-        <configuration>
-          <filesets>
-            <fileset>
-              <directory>${basedir}</directory>
-              <includes>
-                <include>dependency-reduced-pom.xml</include>
-              </includes>
-            </fileset>
-          </filesets>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-shade-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-            <configuration>
-              <relocations>
-                <relocation>
-                  <pattern>io.netty</pattern>
-                  <shadedPattern>${rename.offset}.io.netty</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>com.google</pattern>
-                  <shadedPattern>${rename.offset}.com.google</shadedPattern>
-                </relocation>
-              </relocations>
-              <artifactSet>
-                <excludes>
-                  <!--Exclude protobuf itself. We get a patched version in adjacent module.
-                        Exclude other dependencies of guava, netty, etc.
-                    -->
-                  <exclude>com.google.protobuf:protobuf-java</exclude>
-                  <exclude>com.google.code.findbugs:jsr305</exclude>
-                  <exclude>com.google.errorprone:error_prone_annotations</exclude>
-                  <exclude>com.google.j2objc:j2objc-annotations</exclude>
-                  <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
-                  <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
-                </excludes>
-              </artifactSet>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <!--This trick from
-             https://stackoverflow.com/questions/33825743/rename-files-inside-a-jar-using-some-maven-plugin
-
-            The netty jar has a .so in it. Shading requires rename of the .so and then passing
a system
-            property so netty finds the renamed .so and associates it w/ the relocated netty
files.
-
-            Add this define when running unit tests:
-            
-               mvn test -Dorg.apache.hadoop.hbase.shaded.io.netty.packagePrefix=org.apache.hadoop.hbase.shaded.
-Dtest=TestNettyIPC
-
-            See toward the end of this issue for how to pass config:
-            
-              https://github.com/netty/netty/issues/6665
-
-            TODO: Ensure native works.
-            NOTE: The 'tofile' in the move command below has the relocation hard-coded
-            with '-' instead of '.' separators. If change the relocation, need to change
here too.
-          -->
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-antrun-plugin</artifactId>
-        <version>1.8</version>
-        <executions>
-          <execution>
-            <id>unpack</id>
-            <phase>package</phase>
-            <configuration>
-              <target>
-                <echo message="unjar"/>
-                <unzip src="${project.build.directory}/${project.artifactId}-${project.version}.jar"
-                  dest="${project.build.directory}/unpacked/"/>
-                <echo message="Rename netty .so in META-INF"/>
-                <move file="${project.build.directory}/unpacked/META-INF/native/libnetty-transport-native-epoll.so"
-                  tofile="${project.build.directory}/unpacked/META-INF/native/liborg-apache-hadoop-hbase-shaded-netty-transport-native-epoll.so"
/>
-                <echo message="Redo jar"/>
-                <jar destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar"
-                    basedir="${project.build.directory}/unpacked"/>
-              </target>
-            </configuration>
-            <goals>
-              <goal>run</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-      <version>2.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-      <version>22.0</version>
-    </dependency>
-    <dependency>
-      <groupId>com.google.protobuf</groupId>
-      <artifactId>protobuf-java-util</artifactId>
-      <!--Version should be same as protobuf except sometimes
-           they publish new protobuf version w/o updating util.-->
-      <version>3.3.0</version>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-all</artifactId>
-      <version>4.1.12.Final</version>
-    </dependency>
-  </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/blob/e7f8d0d0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d9a7b31..7da877b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,7 +55,8 @@
   </licenses>
   <modules>
     <module>hbase-shaded-protobuf</module>
-    <module>hbase-shaded-thirdparty</module>
+    <module>hbase-shaded-netty</module>
+    <module>hbase-shaded-miscellaneous</module>
   </modules>
   <scm>
     <connection>scm:git:git://git.apache.org/hbase-thirdparty.git</connection>

http://git-wip-us.apache.org/repos/asf/hbase-thirdparty/blob/e7f8d0d0/src/main/assembly/src.xml
----------------------------------------------------------------------
diff --git a/src/main/assembly/src.xml b/src/main/assembly/src.xml
index ab2d7f4..4b8ca31 100644
--- a/src/main/assembly/src.xml
+++ b/src/main/assembly/src.xml
@@ -30,7 +30,8 @@
       <useAllReactorProjects>true</useAllReactorProjects>
       <includes>
         <include>org.apache.hbase.thirdparty:hbase-shaded-protobuf</include>
-        <include>org.apache.hbase.thirdparty:hbase-shaded-thirdparty</include>
+        <include>org.apache.hbase.thirdparty:hbase-shaded-netty</include>
+        <include>org.apache.hbase.thirdparty:hbase-shaded-miscellaneous</include>
       </includes>
       <!-- Include all the sources in the top directory -->
       <sources>


Mime
View raw message