0
私はhadoopで非常に初期のプログラミングタスクをまとめて、古典的な単語数の問題に行きます。レデューサーが70%で立ち往生しました
サンプルファイルをhdfsに置き、wordcountを実行しようとしました。マッパはうまくいくが、減速機は70%で立ち往生し、前進することはない。
私もローカルファイルシステム上のファイルでこれを試してみましたが、同じ動作をしました。
私は間違っていますか? ここにマッピングして削減されている機能 -
public void map(LongWritable key, Text value,
OutputCollector<Text, IntWritable> output, Reporter reporter)
throws IOException {
// TODO Auto-generated method stub
String line = value.toString();
String[] lineparts = line.split(",");
for(int i=0; i<lineparts.length; ++i)
{
output.collect(new Text(lineparts[i]), new IntWritable(1));
}
public void reduce(Text key, Iterator<IntWritable> values,
OutputCollector<Text, IntWritable> output, Reporter reporter)
throws IOException {
// TODO Auto-generated method stub
int count = 0;
while(values.hasNext())
{
count=count+1;
}
output.collect(key , new IntWritable(count));
}
パーフェクト、バグを見つけてくれてありがとう。 – Gyan