빅데이터 하둡 프로그래밍 교육과정 ]Reducer 클래스의 메소드들





빅데이터 하둡 프로그래밍 교육과정 ]Reducer 클래스의 메소드들

실무개발자를위한 실무교육 전문교육센터학원

www.oraclejava.co.kr에 오시면 보다 다양한 강좌를 보실 수 있습니다.


Reducer 클래스의 메소드들


■ 앞서 본 reduce 메소드이외에도 다음 메소드들이 존재

  - public void setup(Reducer.Context context)

    * Reduce 메소드에서 필요리소스를 여기서 할당 


  - public void cleanup(Reducer.Context context)

    * setup에서 할당한 리소스를 해제.


  - public void run(Reducer.Context context)

    * Reducer의 기본구현은 다음과 같다.


  public void run(Context context) throws IOException, InterruptedException {

    setup(context);

    while (context.nextKey()) {

      reduce(context.getCurrentKey(), context.getValues(), context);

    }

    cleanup(context);

  }



+ Recent posts