나는 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