hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Owen O'Malley" <...@yahoo-inc.com>
Subject Re: sort by value
Date Wed, 06 Feb 2008 23:51:51 GMT

On Feb 6, 2008, at 2:52 PM, Joydeep Sen Sarma wrote:

> ok - got it. This seems to be a subtle drawback in the reduce api.  
> Keys
> in the same reduce group may differ - but the reduce api does not make
> it possible for the reducer function to get access to each key. It  
> only
> gets access to the starting key value for that group.

With a context object api, it would be:

public interface Reducer<KeyIn,ValueIn,KeyOut,ValueOut> extends  
Closeable {
   void reduce(ReducerContext<KeyIn,ValueIn,KeyOut,ValueOut> context
               ) throws IOException, InterruptedException;
}

and the ReducerContext would have:

KeyIn getKey();

to get the key. Then your assumption would work because it would be  
the current key. Now if only I had time to work on HADOOP-1230. *smile*

-- Owen

Mime
View raw message