简体   繁体   English

如何使“ hadoop jar”命令获取相同名称的jar的新版本

[英]How to make 'hadoop jar' command pick up new build of a same named jar

I'm new to hadoop and I tried its example within hadoop 2.6.0 for beginning. 我是hadoop的新手,我在hadoop 2.6.0中尝试了它的示例。
First, I recompiled the source code of hadoop-mapreduce-examples-2.6.0.jar and build a new jar file MapReduce-0.0.1.jar 首先,我重新编译了hadoop-mapreduce-examples-2.6.0.jar的源代码,并构建了一个新的jar文件MapReduce-0.0.1.jar

Then I ran the terasort example with this command line 然后我用此命令行运行了terasort示例

jjin:hadoop$ bin/hadoop jar ~/shared/MapReduce-0.0.1.jar terasort /input /output
15/01/07 12:27:44 INFO terasort.TeraSort: starting
15/01/07 12:27:46 INFO input.FileInputFormat: Total input paths to process : 1
...

After terasort is done, I updated the source of TeraSort.java by modifying the first line log message like this terasort完成后,我通过修改第一行日志消息来更新TeraSort.java的源

public int run(String[] args) throws Exception {
LOG.info("starting..."); 
// Update log message by adding '...' to the end of previous one.
Job job = Job.getInstance(getConf());

But after re-run this terasort job, I found the log message didn't change to 'starting...', so it means that the change I made to TeraSort.java doesn't take effect. 但是,在重新运行此terasort作业后,我发现日志消息未更改为“ starting ...”,因此这意味着我对TeraSort.java所做的更改未生效。

The question is how to make hadoop pick up the new MapReduce-0.0.1.jar I build. 问题是如何让hadoop拾取我构建的新MapReduce-0.0.1.jar Thanks 谢谢

您必须重新编译并重新构建jar,然后指定除第一个作业以外的其他输出目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM