日期:2014-05-17 浏览次数:20626 次
?
job.setMapOutputKeyClass(IntWritable.class); job.setMapOutputValueClass(Text.class); job.setOutputKeyClass(Text.class); job.setOutputValueClass(IntWritable.class);
if (key.getClass() != keyClass) {
??????? throw new IOException("Type mismatch in key from map: expected "
????????????????????????????? + keyClass.getName() + ", recieved "
????????????????????????????? + key.getClass().getName());
????? }
????? if (value.getClass() != valClass) {
??????? throw new IOException("Type mismatch in value from map: expected "
????????????????????????????? + valClass.getName() + ", recieved "
????????????????????????????? + value.getClass().getName());
????? }
在MapOutputBuffer.collet()会检查实际传过来的Key Value 类型,和MapOutputBuffer初始化指定的KeyClass和ValueClass是否一样。?
keyClass = (Class<K>)job.getMapOutputKeyClass();