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

finishedSubMaps field in LocalContainerLauncher does not need to be volatile

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.0
    • Component/s: None
    • Labels:
      None

      Description

      Around line 374:

                if (++finishedSubMaps == numMapTasks) {
                  doneWithMaps = true;
                }
      

      The increment of finishedSubMaps is not atomic.

      See the answer to http://stackoverflow.com/questions/9749746/what-is-the-difference-of-atomic-volatile-synchronize .

      AtomicInteger can be used to achieve atomicity.

        Attachments

        1. MAPREDUCE-5861.1.patch
          2 kB
          Tsuyoshi Ozawa
        2. MAPREDUCE-5861.2.patch
          1 kB
          Tsuyoshi Ozawa

          Activity

            People

            • Assignee:
              ozawa Tsuyoshi Ozawa
              Reporter:
              yuzhihong@gmail.com Ted Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: