[ 
https://issues.apache.org/jira/browse/HADOOP-9162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537702#comment-13537702
 ] 

Binglin Chang commented on HADOOP-9162:
---------------------------------------

bq. Please add this functionality in a separate class instead of 
NativeCodeLoader.
bq. Please add this a command into src/main/bin/hadoop
OK,I will put it in a new class, and add command to bin/hadoop

bq. Given that you are providing the availability status as output, exitcode of 
1 only when native code is not available seems strange. 
I'm assuming people can use this in deploy scripts(tools) to check Native 
library availability, return -1 just a convenience for scripts, I can add a 
argument -a to check all native libraries(all available return 0) and default 
just check libhadoop(libhadoop available return 0).

bq. Because the snappy.jar file may not even be on the classpath, depending on 
the artifacts installed you need to
I was not aware that I imported org.xerial.snappy.Snappy; it must be eclipse 
who mistakenly add it, actually it is not useful at all, I will remove it.

bq. It'll be more useful, if it can print the versions of the native libs as 
well. I've seen in the past it can pick up the wrong libs.
I don't know how to achieve that, it seams a problem to introspect 
System.loadLibrary("hadoop"); to find out which file it actually load.
                
> Add utility to check native library availability
> ------------------------------------------------
>
>                 Key: HADOOP-9162
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9162
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: native
>    Affects Versions: 3.0.0, 2.0.3-alpha
>            Reporter: Binglin Chang
>            Assignee: Binglin Chang
>            Priority: Minor
>         Attachments: HADOOP-9162.patch
>
>
> Many times, after deploy hadoop or when trouble shooting, we need to check 
> whether native library(along with native compression libraries) can work 
> properly, and I just want to use one command to check that, like this:
> hadoop org.apache.hadoop.util.NativeCodeLoader
> and it shows:
> Native library loading test:
> hadoop: false
> zlib:   false
> snappy: false
> lz4:    false

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to