1. jobtracker做了分离,分成了resourceManager和nodemanager;
2. MR变成了和HBase和Hive等一样的yarn上面的一个应用;
3. 1.x的默认块大小为64M,2.x的默认块大小为128M;
4. 在2.x中除了datanode要向namenode报告status,nodemanager也要向ResourceManager报告status
5. MR API差别
旧的WordCount
1 package org.apache.hadoop.mapred; 2 3 ... ... 4 5 public class WordCount extends Configured implements Tool { 6 7 public static class MapClass extends MapReduceBase 8 implements Mapper{ 9 10 ... ...11 12 public void map(LongWritable key, Text value, 13 OutputCollector output, 14 Reporter reporter) throws IOException {15 ... ...16 }17 }18 19 public static class Reduce extends MapReduceBase20 implements Reducer {21 22 public void reduce(Text key, Iterator values,23 OutputCollector output, 24 Reporter reporter) throws IOException {25 ... ...26 }27 }28 29 static int printUsage() {30 System.out.println("wordcount [-m ] [-r ]
新的WordCount
1 package org.apache.hadoop.examples; 2 3 ... ... 4 5 public class WordCount { 6 7 public static class TokenizerMapper 8 extends Mapper
6.