2014-03-24 3 views
0

나는 간단한 Map/Reduce 작업이 있습니다. Mapper가 호출되고 정상적으로 실행되지만 감속기가 호출되지 않습니다.Hadoop Mapreduce : 감속기가 호출되지 않음

구성 :

conf.setJobName("Index Builder"); 
conf.setSpeculativeExecution(false); 

FileInputFormat.setInputPaths(conf, new Path(args[0].toString())); 
FileOutputFormat.setOutputPath(conf, new Path(args[1].toString())); 

conf.setInputFormat(TextInputFormat.class); 
conf.setOutputFormat(NullOutputFormat.class); 

conf.setMapperClass(IndexMapper.class); 
conf.setReducerClass(IndexReducer.class); 

conf.setMapOutputKeyClass(NullWritable.class); 
conf.setMapOutputValueClass(NullWritable.class); 
conf.setOutputValueClass(NullWritable.class); 
conf.setOutputKeyClass(NullWritable.class); 

매퍼 서명 :

public class IndexMapper extends MapReduceBase implements 
    Mapper<LongWritable, Text, NullWritable, NullWritable> { 

    @Override 
    public void map(LongWritable key, Text val, 
    OutputCollector<NullWritable, NullWritable> output, 
    Reporter reporter) throws IOException { 
     // MAP FUNCTION 
    } 

} 

감속기 서명 : 매퍼에 대한

public class IndexReducer extends MapReduceBase implements 
    Reducer<NullWritable, NullWritable, NullWritable, NullWritable> { 

    @Override 
    public void reduce(NullWritable arg0, Iterator<NullWritable> arg1, 
    OutputCollector<NullWritable, NullWritable> arg2, Reporter reporter) 
    throws IOException { 
     // REDUCE CODE 
    } 
} 

답변

0

사용자가 설정 한 출력 형식 로 NullOutputFormat, 그렇지 않은 있도록 아무것도 생산하지 마십시오. 따라서 감속기는 실행하기 위해 데이터가 필요하기 때문에 호출되지 않습니다.

관련 문제