본문 바로가기

전체 글170

Reducer - Reducer 클래스에서는 맵 태스크의 출력 데이타를 입력 데이터로 전달받아-집계 연산을 수행한다. - public class Reducer 예) public static class MyReduce extends Reducer { private LongWritable sumWritable = new LongWritable(); public void reduce(Text key, Iterable values, Context context) throws IOException, InterruptedException{ long sum = 0; for(LongWritable val : values) { sum += val.get(); } sumWritable.set(sum); context.write(key,.. 2014. 6. 9.
Partitioner - Partitioner는 맵 태스크의 출력 데이터가 어떤 리듀스 태스크로 전달될지 결정한다. 2014. 6. 9.
Mapper - Mapper는 맴리듀스 프로그래밍 모댈에서 뱀 메서드의 기능을 수행한다. Mapper는 키와 값으로 구성된 입력 데이터를 전달받아 이 데이터를 가공하고 분류해서 새로운 데이터 목록을 생성한다. - public class Mapper 예) public class TokenCounterMapper extends Mapper{ private final static IntWritable one = new IntWritable(1); private Text word = new Text(); public void map(Object key, Text value, Context context) throws IOException, InterruptedException { StringTokenizer itr = ne.. 2014. 6. 9.
Inputformat 유형 - TextInputFormat 텍스트 파일을 분석할 때 사용하며, 캐리지 리턴 값(\r\n)을 기준으로 례코드를 분류한다. 키는 라인 번호이며, LongWritable 타입을 사용한다. 값은 라인의 내용이며, Text 타입을 사용한다. - KeyValueTextInputFormat 텍스트 파일을 입력 파일로 사용할 때 라인 번호가 아닌 임의의 키값을 지정해서 키와 값의 목록으로 사용한다. - NLineInputFormat 맵 태스크가 입럭 받을 텍스트 파일의 라인 수를 제한하고 싶을 때 사용한다. - DelegatingInputFormat 여러 개의 서로 다른 입력 포뱃을 사용하는 정우에 각 경로에 대한 작업 을위임한다. - CombineFileInputFormat 이 표에 있는 다른 InputForm.. 2014. 6. 9.