[ 
https://issues.apache.org/jira/browse/MAPREDUCE-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790119#action_12790119
 ] 

Ankit Modi commented on MAPREDUCE-1214:
---------------------------------------

Hi Jeff

I am trying to access counter values in code in pig. This is how it is done for 
Hadoop MR mode.

I am not able to replicate the process in Hadoop Local mode as we don't have an 
AssignedJobId.

{code}
RunningJob rj = jobClient.getJob( job.getAssignedJobID() );
Counters counters = rj.getCounters();
Counters.Group taskgroup = 
counters.getGroup("org.apache.hadoop.mapred.Task$Counter");
value = taskgroup.getCounterForName("REDUCE_OUTPUT_RECORDS").getCounter();
value2 = taskgroup.getCounterForName("MAP_OUTPUT_RECORDS").getCounter();
{code}

Is this the correct way, or am I missing something ?

> Add support for counters in Hadoop Local Mode
> ---------------------------------------------
>
>                 Key: MAPREDUCE-1214
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-1214
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>            Reporter: Ankit Modi
>
> Currently there is no support for counters ( Records and Bytes written ) in 
> Hadoop Local Mode.
> Pig requires to provide counters to user when running in Hadoop Local Mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to