You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-commits@hadoop.apache.org by vi...@apache.org on 2014/06/11 14:20:51 UTC
svn commit: r1601869 - in
/hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project: ./ CHANGES.txt
hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/WordCount.java
Author: vinayakumarb
Date: Wed Jun 11 12:20:48 2014
New Revision: 1601869
URL: http://svn.apache.org/r1601869
Log:
Merged revision(s) 1601144-1601868, 1598456-1601149 from hadoop/common/trunk
Modified:
hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/ (props changed)
hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/CHANGES.txt (contents, props changed)
hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/WordCount.java
Propchange: hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-mapreduce-project:r1601151-1601868
Modified: hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/CHANGES.txt?rev=1601869&r1=1601868&r2=1601869&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/CHANGES.txt Wed Jun 11 12:20:48 2014
@@ -207,6 +207,12 @@ Release 2.5.0 - UNRELEASED
MAPREDUCE-5899. Support incremental data copy in DistCp. (jing9)
+ MAPREDUCE-5886. Allow wordcount example job to accept multiple input paths.
+ (cnauroth)
+
+ MAPREDUCE-5834. Increased test-timeouts in TestGridMixClasses to avoid
+ occassional failures. (Mit Desai via vinodkv)
+
OPTIMIZATIONS
BUG FIXES
Propchange: hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/CHANGES.txt
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt:r1601151-1601868
Modified: hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/WordCount.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/WordCount.java?rev=1601869&r1=1601868&r2=1601869&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/WordCount.java (original)
+++ hadoop/common/branches/HDFS-5442/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/WordCount.java Wed Jun 11 12:20:48 2014
@@ -68,8 +68,8 @@ public class WordCount {
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
- if (otherArgs.length != 2) {
- System.err.println("Usage: wordcount <in> <out>");
+ if (otherArgs.length < 2) {
+ System.err.println("Usage: wordcount <in> [<in>...] <out>");
System.exit(2);
}
Job job = new Job(conf, "word count");
@@ -79,8 +79,11 @@ public class WordCount {
job.setReducerClass(IntSumReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
- FileInputFormat.addInputPath(job, new Path(otherArgs[0]));
- FileOutputFormat.setOutputPath(job, new Path(otherArgs[1]));
+ for (int i = 0; i < otherArgs.length - 1; ++i) {
+ FileInputFormat.addInputPath(job, new Path(otherArgs[i]));
+ }
+ FileOutputFormat.setOutputPath(job,
+ new Path(otherArgs[otherArgs.length - 1]));
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}