1
** 다음 라인의 의미를 알고 싶습니다. 저는 자바를 처음 사용하고 있으며 이것은 제 과제 중 일부입니다.하둡에서 워드 카운트를 설명하십시오.
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
//According to my knowledge we are using this to set the line as a string
String line = value.toString();
//each string is now divided into indovidual words
StringTokenizer tokenizer = new StringTokenizer(line);
//How are we setting the end limit of the loop ?
while (tokenizer.hasMoreTokens()) {
//what is word.set operation is doing here?
word.set(tokenizer.nextToken());
}
//What is context ? and how are we giving the output to the reducer?
context.write(word, one);
}