mrunit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Hunt (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MRUNIT-163) getTaskAttemptID is missing from context
Date Thu, 22 Nov 2012 01:08:59 GMT

    [ https://issues.apache.org/jira/browse/MRUNIT-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13502503#comment-13502503
] 

Patrick Hunt commented on MRUNIT-163:
-------------------------------------

I think a dummy would be fine to start. For my case at least.

fyi I found a workaround:

{noformat}
    Reducer<Text, SolrInputDocumentWritable, Text, SolrInputDocumentWritable>.Context
context = reduceDriver.getContext();
    when(context.getTaskAttemptID()).thenAnswer(new Answer<TaskAttemptID>() {
      @Override
      public TaskAttemptID answer(final InvocationOnMock invocation) {
        return new TaskAttemptID(new TaskID(), 0);
      }
    });
{noformat}

                
> getTaskAttemptID is missing from context
> ----------------------------------------
>
>                 Key: MRUNIT-163
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-163
>             Project: MRUnit
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Patrick Hunt
>
> I'm trying to get the task attempt id in my reducer test code however it's null:
> org.apache.hadoop.mapreduce.TaskAttemptContext.getTaskAttemptID()
> It would be good to provide a value for this to the user code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message