You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by Steve Lewis <lo...@gmail.com> on 2011/06/23 00:12:03 UTC

Is there any way for the reducer to determine the total number of reduce tasks?

Also is there a good way in code to determine whether job is running on a
cluster or in local mode.

I want certain debugging information to log only in local mode

-- 
Steven M. Lewis PhD
4221 105th Ave NE
Kirkland, WA 98033
206-384-1340 (cell)
Skype lordjoe_com

Re: Is there any way for the reducer to determine the total number of reduce tasks?

Posted by Matei Zaharia <ma...@eecs.berkeley.edu>.
You can implement the configure() method of the Reducer interface and look at the properties in the JobConf. In particular, "mapred.reduce.tasks" is the number of reduce tasks and "mapred.job.tracker" will be set to "local" when running in local mode.

Matei

On Jun 22, 2011, at 3:12 PM, Steve Lewis wrote:

> Also is there a good way in code to determine whether job is running on a cluster or in local mode.
> 
> I want certain debugging information to log only in local mode
> 
> -- 
> Steven M. Lewis PhD
> 4221 105th Ave NE
> Kirkland, WA 98033
> 206-384-1340 (cell)
> Skype lordjoe_com
> 
>