출력을 쓰기는 시나리오 나 다른 파일에 데이터를 기록 할 감속기에서하둡 스트리밍 : 다른 파일
Reducer1
/
Mapper - - Reducer2
\
ReducerN
입니다
def reduce():
for line in sys.STDIN:
if(line == type1):
create_type_1_file(line)
if(line == type2):
create_type_2_file(line)
if(line == type3):
create_type3_file(line)
... and so on
def create_type_1_file(line):
# writes to file1
def create_type2_file(line):
# writes to file2
def create_type_3_file(line):
# write to file 3
이 생각처럼 감속기 보이는 말할 수 경로는 다음과 같이 작성하십시오 :
file1 = /home/user/data/file1
file2 = /home/user/data/file2
file3 = /home/user/data/file3
pseudo-distributed mode(machine with one node and hdfs daemons running)
에서 실행하면 모든 것이 d aemons는 같은 파일 집합에 글을 쓸 것입니다.
질문 : -이 파일을 1000 대의 컴퓨터 클러스터에서 실행하면 동일한 파일 집합에도 쓸 수 있습니까? 이 경우 writing to local filesystem
입니다.
- hadoop streaming
에서이 작업을 수행하는 더 좋은 방법이 있습니까? 노드 중 하나가 다음 아래로 그 손실 노드와 관련된 감소 데이터를 이동하는 경우 때문에
이 답변이 도움이 될 수 있습니다 (확실하지, 따라서 코멘트 감속기의
사용) http://stackoverflow.com/questions/162 6786/생성 독립 출력 파일 인 하프 스트리밍/1690092 # 1690092 – Nija