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

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.5.0
    • None
    • 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.2.patch
          1 kB
          Tsuyoshi Ozawa
        2. MAPREDUCE-5861.1.patch
          2 kB
          Tsuyoshi Ozawa

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: