0

我曾经使用(这使用 GenericOptionsParser)运行 hadoop mapreduce

hadoop jar app.jar app -files /home/some/file#file

但是在最新版本的hadoop中,我得到了

Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.

那么如何-files使用 ToolRunner 实现在所有 mapreduce 节点之间共享的选项呢?

4

1 回答 1

0

显然以前的已经被弃用了......

这就是我所做的......

import org.apache.hadoop.conf.Configuration; . . . Configuration conf = new Configuration(); . Job job = Job.getInstance(conf, "appname"); job.setJarByClass(appname.class); . . job.addCacheFile(new URI("/file/in/hdfs/APP/appfile#appfile")); . .

于 2014-12-11T21:23:37.247 回答