hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Templeton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAPREDUCE-6535) TaskID default constructor results in NPE on toString()
Date Wed, 04 Nov 2015 22:56:27 GMT

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

Daniel Templeton commented on MAPREDUCE-6535:

It's a custom OutputFormat that's using the TaskAttemptID to build the output path.  It works
in MR1.

I agree that mucking with {{toString()}} has the potential to be a can of worms.  The other
alternative would be to lock down the default constructors in some way so that users know
not to use them.

> 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

View raw message