0
hadoop-1.0.1에서 애플리케이션을 실행하고 싶습니다. 애플리케이션이 맵 기능에 들어 가지 않습니다. hadoop local에서 응용 프로그램은 제대로 실행되지만 분산 된 hadoop에서는 map 함수가 호출되지 않습니다.맵 기능이 hadoop에 호출되지 않았습니다.
나는이 구조에게 도움을
Class Embed {
public static class Map extends MapReduceBase implements Mapper<LongWritable, Text, Text, LongWritable> {
public void map(LongWritable key, Text value, OutputCollector<Text, LongWritable> output, Reporter reporter) throws IOException {
........
}
}
public static class Reduce extends MapReduceBase implements Reducer<Text, LongWritable, Text, LongWritable> {
public void reduce(Text key, Iterator<LongWritable> values, OutputCollector<Text, LongWritable> output, Reporter reporter) throws IOException {
..........
}
public static void main(String[] args) throws Exception {
readArguments(args);
JobConf conf = new JobConf(Embed.class);
conf.setJobName("embed");
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(LongWritable.class);
conf.setMapperClass(Map.class);
//conf.setCombinerClass(Reduce.class);
conf.setReducerClass(Reduce.class);
conf.setInputFormat(TextInputFormat.class);
conf.setOutputFormat(TextOutputFormat.class);
FileInputFormat.setInputPaths(conf, new Path(input));
FileOutputFormat.setOutputPath(conf, new Path(output));
JobClient.runJob(conf);
}
}
감사합니다.
입력 경로가 유효합니다. –