diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 02c16e1..e128e88 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,6 +3,7 @@ + @@ -19,8 +20,8 @@ - - + + @@ -29,7 +30,7 @@ - + @@ -41,8 +42,8 @@ - - + + @@ -122,8 +123,8 @@ @@ -505,7 +506,7 @@ - + 1521904777876 @@ -542,7 +543,14 @@ - @@ -578,7 +586,7 @@ - @@ -625,7 +633,8 @@ - @@ -918,14 +927,6 @@ - - - - - - - - @@ -943,16 +944,6 @@ - - - - - - - - - - @@ -991,10 +982,28 @@ + + + + + + + + + + + + + + + + + + - - + + diff --git a/pom.xml b/pom.xml index fd500f3..6137ba9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.fjy.hadoop hadoopstudy - 1.0-SNAPSHOT + 0.3 jar hadoopstudy diff --git a/src/main/java/com/fjy/hadoop/mapreduce/WordCountApp.java b/src/main/java/com/fjy/hadoop/mapreduce/WordCountApp.java index c75ed56..20e6953 100644 --- a/src/main/java/com/fjy/hadoop/mapreduce/WordCountApp.java +++ b/src/main/java/com/fjy/hadoop/mapreduce/WordCountApp.java @@ -119,6 +119,10 @@ public class WordCountApp { job.setOutputKeyClass(Text.class); job.setOutputValueClass(LongWritable.class); + //通过job设置combiner处理类,逻辑上与reduce一致,注意,如果要计算平均数等不能使用Combiner! + job.setCombinerClass(MyReducer.class); + + //设置作业处理输出结果的输出路径 FileOutputFormat.setOutputPath(job, new Path(args[1]));