[
https://issues.apache.org/jira/browse/MAPREDUCE-6535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14990686#comment-14990686
]
Jason Lowe commented on MAPREDUCE-6535:
---------------------------------------
bq. It works in MR1.
I was surprised by that, so I went looking at how it would end up working in
MR1. That code basically defaults to a reducer with ID 0 since it has a
boolean for the type rather than an enum. Seems like we could simply do the
same thing and default the task type to TaskType.REDUCE since that's
effectively what the old code did as well.
> TaskID default constructor results in NPE on toString()
> -------------------------------------------------------
>
> Key: MAPREDUCE-6535
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-6535
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Components: mrv2
> Affects Versions: 2.6.0
> Reporter: Daniel Templeton
> Assignee: Daniel Templeton
>
> This code will reproduce the issue:
> {code}
> new TaskAttemptID().toString();
> {code}
> The issue is that the default constructor leaves the type {{null}}. The
> {{get()}} in {{CharTaskTypesMaps.getRepresentingCharacter()}} then throws an
> NPE on the null type key.
> The simplest solution would be to only call the {{get()}} on line 288 of
> {{TaskID.java}} if {{type}} is not {{null}} and return some other literal
> otherwise. Since no part of the code is tripping on the NPE, what we choose
> for the literal shouldn't matter. How about "x"?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)