xichen01 commented on code in PR #8008:
URL: https://github.com/apache/ozone/pull/8008#discussion_r1986097817


##########
hadoop-ozone/ozonefs-shaded/pom.xml:
##########
@@ -120,38 +151,70 @@
                 <relocation>
                   <pattern>org</pattern>
                   <shadedPattern>${shaded.prefix}.org</shadedPattern>
-                  <includes>
-                    <include>org.yaml.**.*</include>
-                    <include>org.sqlite.**.*</include>
-                    <include>org.tukaani.**.*</include>
-                    <include>org.bouncycastle.**.*</include>
-                    <include>org.rocksdb.**.*</include>
-                    <include>org.apache.commons.cli.**.*</include>
-                    <include>org.apache.commons.compress.**.*</include>
-                    <include>org.apache.commons.codec.**.*</include>
-                    <include>org.apache.commons.beanutils.**.*</include>
-                    <include>org.apache.commons.collections.**.*</include>
-                    <include>org.apache.commons.digester.**.*</include>
-                    <include>org.apache.commons.io.**.*</include>
-                    <include>org.apache.commons.logging.**.*</include>
-                    <include>org.apache.commons.validator.**.*</include>
-                    <include>org.apache.commons.lang3.**.*</include>
-                    <include>org.sqlite.**.*</include>
-                    <include>org.apache.thrift.**.*</include>
-                  </includes>
+                  <excludes>
+                    <exclude>org.apache.hadoop.**</exclude>
+                    <exclude>org.apache.log4j.**</exclude>
+                    <exclude>org.apache.ozone.**</exclude>
+                    <exclude>org.apache.ratis.**</exclude>
+                    <!-- These packages are the ones that are not shaded in 
the hadoop release package.
+                      To prevent conflicts, we do not include these packages 
in the ozone client release package.
+                      Ozone will use hadoop / JVM to provide these 
dependencies. -->
+                    <exclude>org.ietf.jgss.*</exclude>
+                    <exclude>org.omg.**</exclude>
+                    <exclude>org.slf4j.**</exclude>
+                    <exclude>org.w3c.dom.**</exclude>
+                    <exclude>org.xerial.snappy.**</exclude>
+                    <exclude>org.xml.sax.**</exclude>
+                    <exclude>org.wildfly.**</exclude>
+                  </excludes>
+                </relocation>
+                <relocation>
+                  <pattern>org.apache.ratis</pattern>
+                  
<shadedPattern>${shaded.prefix}.org.apache.ratis</shadedPattern>
+                  <!-- thirdparty netty will use native library and cannot be 
relocated -->
+                  <excludes>
+                    <exclude>org.apache.ratis.thirdparty.io.netty.**</exclude>

Review Comment:
   To add this is because the so library in META-INF/native/ is not shaded, and 
NativeLibraryLoader.load loads the name after shade.
   
   ```bash
   java.lang.IllegalArgumentException: Failed to load any of the given 
libraries: [netty_tcnative_linux_x86_64_fedora, netty_tcnative_linux_x86_64, 
netty_tcnative_x86_64, netty_tcnative]
   ///..
           Caused by: java.io.FileNotFoundException: 
META-INF/native/liborg_apache_hadoop_ozone_shaded_org_apache_ratis_thirdparty_netty_tcnative_linux_x86_64.so
                   at 
org.apache.hadoop.ozone.shaded.org.apache.ratis.thirdparty.io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:186)
   //...
   ```
   
   Actual file is:
   ```bash
   % ls META-INF/native | grep ratis
   liborg_apache_ratis_thirdparty_netty_resolver_dns_native_macos_x86_64.jnilib
   liborg_apache_ratis_thirdparty_netty_tcnative_linux_aarch_64.so
   liborg_apache_ratis_thirdparty_netty_tcnative_linux_x86_64.so
   liborg_apache_ratis_thirdparty_netty_tcnative_osx_aarch_64.jnilib
   liborg_apache_ratis_thirdparty_netty_tcnative_osx_x86_64.jnilib
   liborg_apache_ratis_thirdparty_netty_transport_native_epoll_aarch_64.so
   liborg_apache_ratis_thirdparty_netty_transport_native_epoll_x86_64.so
   liborg_apache_ratis_thirdparty_netty_transport_native_kqueue_x86_64.jnilib
   org_apache_ratis_thirdparty_netty_tcnative_windows_x86_64.dll
   ```
   
   @adoroszlai @szetszwo Is there a better solution?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to