[ 
https://issues.apache.org/jira/browse/HADOOP-17891?focusedWorklogId=648283&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-648283
 ]

ASF GitHub Bot logged work on HADOOP-17891:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Sep/21 00:34
            Start Date: 09/Sep/21 00:34
    Worklog Time Spent: 10m 
      Work Description: viirya commented on a change in pull request #3385:
URL: https://github.com/apache/hadoop/pull/3385#discussion_r704865424



##########
File path: 
hadoop-client-modules/hadoop-client-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh
##########
@@ -67,6 +67,8 @@ allowed_expr+="|^krb5_udp-template.conf$"
 # Jetty uses this style sheet for directory listings. TODO ensure our
 # internal use of jetty disallows directory listings and remove this.
 allowed_expr+="|^jetty-dir.css$"
+# Snappy java is native library. We cannot relocate it to under 
org/apache/hadoop.

Review comment:
       By default, JNI uses fully qualified class name to resolve native 
methods. Alternatively, JNI provides an API `RegisterNatives` used to register 
native methods that don't require to match with class name.




-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 648283)
    Time Spent: 8h 20m  (was: 8h 10m)

> lz4-java and snappy-java should be excluded from relocation in shaded Hadoop 
> libraries
> --------------------------------------------------------------------------------------
>
>                 Key: HADOOP-17891
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17891
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: L. C. Hsieh
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 8h 20m
>  Remaining Estimate: 0h
>
> lz4-java is a provided dependency. So in the shaded Hadoop libraries, e.g. 
> hadoop-client-api, if we don't exclude lz4 dependency, the downstream will 
> still see the exception even they include lz4 dependency.
> {code:java}
> [info]   Cause: java.lang.ClassNotFoundException: 
> org.apache.hadoop.shaded.net.jpountz.lz4.LZ4Factory
> [info]   at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
> [info]   at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
> [info]   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
> [info]   at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
> [info]   at 
> org.apache.hadoop.io.compress.lz4.Lz4Compressor.<init>(Lz4Compressor.java:66)
> [info]   at 
> org.apache.hadoop.io.compress.Lz4Codec.createCompressor(Lz4Codec.java:119)
> [info]   at 
> org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:152)
> [info]   at 
> org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:168)
>  {code}
> Currently snappy-java is included and relocated in Hadoop shaded client 
> libraries. But as it includes native methods, it should not be relocated too 
> due to JNI method resolution. The downstream will see the exception:
> {code}
> [info]   Cause: java.lang.UnsatisfiedLinkError: 
> org.apache.hadoop.shaded.org.xerial.snappy.SnappyNative.rawCompress(Ljava/nio/ByteBuffer;IILjava/nio/ByteBuffer;I)I
> [info]   at 
> org.apache.hadoop.shaded.org.xerial.snappy.SnappyNative.rawCompress(Native 
> Method)                                                                       
>                           
> [info]   at 
> org.apache.hadoop.shaded.org.xerial.snappy.Snappy.compress(Snappy.java:151)   
>                                                                               
>                        
> [info]   at 
> org.apache.hadoop.io.compress.snappy.SnappyCompressor.compressDirectBuf(SnappyCompressor.java:282)
> [info]   at 
> org.apache.hadoop.io.compress.snappy.SnappyCompressor.compress(SnappyCompressor.java:210)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to