0

hadoop-1.0.1 でアプリケーションを実行したいのですが、アプリケーションが map 関数に入らないことに気付きました。Hadoop ローカルではアプリケーションは適切に実行されますが、分散 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);

}
}

ご協力いただきありがとうございます。

4

1 に答える 1

0

入力パスがサーバーに対して有効であることを確認してください。そこにデータがない場合、レコードごとに 1 回呼び出されるため、マッパーは呼び出されません。

于 2013-09-05T15:06:30.143 に答える