how to access a mapper counter in reducer

2011-11-30 Thread rabbit_cheng
I have created a counter in mapper to count something, I wanna get the counter's value in reducer phase, the code segment is as follow: public class MM extends Mapper { static enum TEST{ pt } @Override public void map(LongWritable key, Text values, Context context) throws IOExceptio

Re:Re: how to implement error thresholds in a map-reduce job ?

2011-11-15 Thread rabbit_cheng
I think David's solution is viable, but don't use a local variable as a counter in step 4, use a COUNTER object to count the error record, the COUNTER object can work globally. At 2011-11-16 03:08:45,"Mapred Learn" wrote: Thanks David for a step-by-step response but this makes error threshol

Re:Re: how can I get the number of reducer in Map

2011-07-26 Thread rabbit_cheng
and get the value out >of the configuration instance passed to the mapper instead of >instantiating a new one (with defaults). > >2011/7/26 rabbit_cheng : >> In my map function, I need to know the number of reducer, the code segment >> in my program like this: >

how can I get the number of reducer in Map

2011-07-26 Thread rabbit_cheng
In my map function, I need to know the number of reducer, the code segment in my program like this: JobConf job = new JobConf(driverClass.class); int numReducer=job.getNumReduceTasks(); but the function invocation job.getNumReduceTasks() always returns the value of "1". I have tested many