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

Steve Loughran commented on HADOOP-9162:
----------------------------------------

bq. 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.

I don't see an easy cross platform way either -unless the libraries themselves 
return a version number. We could add that to the Hadoop-specific codecs, but 
not to Snappy. 

Regarding tests, if you use {{ExitUtils.terminate()}} instead of 
{{System.exit()}}, you can write a test which calls the {{main()}} function 
with different args, -after disabling exit with 
{{ExitUtils.disableSystemExit()}} -this will cause an {{ExitException}} to be 
thrown instead of the process exiting. That would let you write some unit tests 
that check the class behaviour.
                
> 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, HADOOP-9162.v2.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