나는 그것을 할 것입니다 방법 :
- 분할 값 (* 1)
- 당신이 얻을 것이다 '감소'(< 단어>, < 소스>) 방출, 단어 '지도'에 (< 단어>, 소스 < 목록>)
- 체크 소스 목록, <
- 모든 소스가 목록에 있지 않은 경우, 모든 시간을 방출 (< missingsource> (/ 모든 소스 모두 긴 수 있습니다) 단어>)
- 작업 2 : job.setNumReduceTasks (< numberofsources>)
- 작업 2 :에 방출 (>,> < 단어를 < missingsource)을 '지도'
- 작업 2 : 널 (null) (모든 '감소'의 각 < missingsource>에 대한 방출, 당신은 각 문서에 대한 누락 된 단어를 포함, 다른 < missingsources로> - 출력을 감소 정도 될 겁니다
< 단어>). 파일을 표시하기 위해 'reduce'시작 부분에 < missingsource> ONCE를 쓸 수 있습니다.
(* 1) 하우투지도에서 소스 (0.20) 발견 :
private String localname;
private Text outkey = new Text();
private Text outvalue = new Text();
...
public void setup(Context context) throws InterruptedException, IOException {
super.setup(context);
localname = ((FileSplit)context.getInputSplit()).getPath().toString();
}
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
...
outkey.set(...);
outvalue.set(localname);
context.write(outkey, outvalue);
}
안녕, 난 당신이 거의 같은 일을 implemet해야하지만, 나는이를 만들기 위해 관리 초보자를 하둡 정말 해달라고 :/제발 내 질문을보고 나에게 약간의 피드백을 줄 수 있니, 정말로 고투하고 도저히 도움이되지 않아./ http://stackoverflow.com/questions/2986271/need-help-implementing-this-algorithm -with-map-hadoop-mapreduce – Julia