You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/12/03 11:32:00 UTC

[jira] [Commented] (HADOOP-18982) Fix doc about loading native libraries

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

ASF GitHub Bot commented on HADOOP-18982:
-----------------------------------------

Hexiaoqiao commented on code in PR #6281:
URL: https://github.com/apache/hadoop/pull/6281#discussion_r1413053871


##########
hadoop-common-project/hadoop-common/src/site/markdown/NativeLibraries.md.vm:
##########
@@ -128,8 +128,8 @@ You can load any native shared library using DistributedCache for distributing a
 
 This example shows you how to distribute a shared library, mylib.so, and load it from a MapReduce task.
 
-1.  First copy the library to the HDFS: `bin/hadoop fs -copyFromLocal mylib.so.1 /libraries/mylib.so.1`
-2.  The job launching program should contain the following: `DistributedCache.createSymlink(conf);` `DistributedCache.addCacheFile("hdfs://host:port/libraries/mylib.so. 1#mylib.so", conf);`
-3.  The MapReduce task can contain: `System.loadLibrary("mylib.so");`
+1.  First copy the library to the HDFS: `bin/hadoop fs -copyFromLocal libmyexample.so.1 /libraries/libmyexample.so.1`
+2.  The job launching program should contain the following: `DistributedCache.createSymlink(conf);` `DistributedCache.addCacheFile("hdfs://host:port/libraries/libmyexample.so.1#libmyexample.so", conf);`
+3.  The MapReduce task can contain: `System.loadLibrary("myexample");`

Review Comment:
   +1. LGTM. One nit comments, we should mark which platform is it suitable, such as `Unix-like systems`. because it should be another approach for win32 platform from the [document](https://docs.oracle.com/en/java/javase/11/docs/specs/jni/design.html#compiling-loading-and-linking-native-methods).





> Fix doc about loading native libraries
> --------------------------------------
>
>                 Key: HADOOP-18982
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18982
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Shuyan Zhang
>            Priority: Major
>              Labels: pull-request-available
>
> When we want load a native library libmyexample.so, the right way is to call 
> System.loadLibrary("myexample") rather than System.loadLibrary("libmyexample.so").



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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