Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-4822

Unnecessary conversions in History Events

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      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:

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

      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.

      Attachments

        1. MAPREDUCE-4822.patch
          4 kB
          Chu Tong

        Activity

          People

            stayhf Chu Tong
            revans2 Robert Joseph Evans
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: