0
코드 실행 중에 내 map() 함수가 전혀 호출되지 않은 것 같아서 그 이유를 이해할 수 없습니다. 다음은 내 작업의 클래스 ...Hadoop map() 함수가 호출되지 않습니다.
public class MyHadoopJob extends Configured implements Tool{
static class MyMapper extends Mapper<LongWritable, Text, LongWritable, Text>{
public MyMapper(){
System.out.println("Mapper init!");
}
@Override
protected void map(LongWritable key, Text value,
org.apache.hadoop.mapreduce.Mapper<LongWritable, Text, LongWritable, Text>.Context context)
throws java.io.IOException, InterruptedException {
System.out.println("MAP!");
context.getCounter("mygroup", "jeff").increment(1);
context.write(key, value);
};
}
@Override
public int run(String[] strings) throws Exception {
Configuration conf = MYOBJ.getHadoopConf();
this.setConf(conf);
Job job = new Job(conf, "MyJob");
job.setJarByClass(MyHadoopJob.class);
job.setMapperClass(MyMapper.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
job.setMapOutputKeyClass(LongWritable.class);
job.setMapOutputValueClass(Text.class);
FileInputFormat.setInputPaths(job, new Path(strings[0]));
FileOutputFormat.setOutputPath(job, new Path(strings[1]));
job.waitForCompletion(true);
for(int i = 0; i < 10; i++){
log.info("Progress -> " + job.mapProgress());
Thread.sleep(15000);
}
return 0;
}
}
정말 왜지도() 클래스 또는이 실제로 클래스의 초기화가 절대 호출되지됩니까 알아내는 어떤 도움을 주셔서 감사합니다 것입니까?
작업을 실행할 때 무엇이 표시됩니까? –