org.infinispan.distexec.mapreduce
Interface Reducer<T,R>


public interface Reducer<T,R>

Reduces a list of results T from map phase of MapReduceTask. Infinispan distributed execution environment creates one instance of Reducer per execution node.

Since:
5.0
Author:
Manik Surtani, Vladimir Blagojevic

Method Summary
 R reduce(T mapResult, R previouslyReduced)
          Reduces a result T from map phase and return R.
 

Method Detail

reduce

R reduce(T mapResult,
         R previouslyReduced)
Reduces a result T from map phase and return R.

Assume that on Infinispan node N, an instance of Mapper was mapped and invoked on k many key/value pairs. Each T(i) in the list of all T's returned from map phase executed on Infinispan node N is passed to reducer along with previsouly computed R(i-1). Finally the last invocation of reducer on T(k), R is returned to a distributed task that originated map/reduce request.

Parameters:
mapResult - result T of map phase
previouslyReduced - previously accumulated reduced result
Returns:
result R


Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.