java 编写hadoop程序中使用第三方libxx.so库

在使用java编写hadoop处理程序时遇到了,java使用依赖的第三方libxx.so库的情况,找到了一种可行的方法,记录一下,希望对别人也有帮助;

加入需要使用的lib库为libxxx.so

1.先将该库放到hdfs中. /user/xx/libxxx.so

2.在java代码中添加如下代码

DistributedCache.addCacheFile(new URI("hdfs://hdfsip:port/user/xx/libxxx.so#libxxx.so"));
 
DistributedCache.createSymLink(conf);

 

posted @ 2014-02-27 21:09  anexplore  阅读(506)  评论(0编辑  收藏  举报