You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Robert Joseph Evans (JIRA)" <ji...@apache.org> on 2012/11/27 16:47:58 UTC

[jira] [Created] (MAPREDUCE-4822) Unnessisary conversions in History Events

Robert Joseph Evans created MAPREDUCE-4822:
----------------------------------------------

             Summary: Unnessisary conversions in History Events
                 Key: MAPREDUCE-4822
                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4822
             Project: Hadoop Map/Reduce
          Issue Type: Improvement
          Components: jobhistoryserver
    Affects Versions: 0.23.4
            Reporter: Robert Joseph Evans
            Priority: Trivial


There are a number of conversions in the Job History Event classes that are totally unnecessary.  It appears that they were originally used to convert from the internal avro format, but now many of them do not pull the values from the avro they store them internally.

For example:

{code:title=TaskAttemptFinishedEvent.java}
  /** Get the task type */
  public TaskType getTaskType() {
    return TaskType.valueOf(taskType.toString());
  }
{code}

The code currently is taking an enum, converting it to a string and then asking the same enum to convert it back to an enum.  If java work properly this should be a noop and a reference to the original taskType should be returned.

There are several places that a string is having toString called on it, and since strings are immutable it returns a reference to itself.

The various ids are not immutable and probably should not be changed at this point.

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

[jira] [Updated] (MAPREDUCE-4822) Unnecessary conversions in History Events

Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAPREDUCE-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron T. Myers updated MAPREDUCE-4822:
--------------------------------------

    Summary: Unnecessary conversions in History Events  (was: Unnessisary conversions in History Events)
    
> Unnecessary conversions in History Events
> -----------------------------------------
>
>                 Key: MAPREDUCE-4822
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4822
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobhistoryserver
>    Affects Versions: 0.23.4
>            Reporter: Robert Joseph Evans
>            Priority: Trivial
>
> There are a number of conversions in the Job History Event classes that are totally unnecessary.  It appears that they were originally used to convert from the internal avro format, but now many of them do not pull the values from the avro they store them internally.
> For example:
> {code:title=TaskAttemptFinishedEvent.java}
>   /** Get the task type */
>   public TaskType getTaskType() {
>     return TaskType.valueOf(taskType.toString());
>   }
> {code}
> The code currently is taking an enum, converting it to a string and then asking the same enum to convert it back to an enum.  If java work properly this should be a noop and a reference to the original taskType should be returned.
> There are several places that a string is having toString called on it, and since strings are immutable it returns a reference to itself.
> The various ids are not immutable and probably should not be changed at this point.

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