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
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
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:
>
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