HADOOP-18982. Fix doc about loading native libraries. (#6281). Contributed by Shuyan Zhang.
Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
This commit is contained in:
parent
931fa49363
commit
809ae58e71
@ -126,10 +126,10 @@ Native Shared Libraries
|
||||
|
||||
You can load any native shared library using DistributedCache for distributing and symlinking the library files.
|
||||
|
||||
This example shows you how to distribute a shared library, mylib.so, and load it from a MapReduce task.
|
||||
This example shows you how to distribute a shared library in Unix-like systems, 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");`
|
||||
|
||||
Note: If you downloaded or built the native hadoop library, you don’t need to use DistibutedCache to make the library available to your MapReduce tasks.
|
||||
|
Loading…
Reference in New Issue
Block a user