Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-11409

DatanodeInfo getNetworkLocation and setNetworkLocation shoud use volatile instead of synchronized

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-alpha4, 2.8.4
    • Component/s: performance
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      DatanodeInfo has synchronized methods getNetworkLocation and setNetworkLocation. While they doing nothing more than setting and getting variable location.

      Since location is not being modified based on its current value and is independent from any other variables. This JIRA propose to remove synchronized methods but only make location volatile. Such that threads will not be blocked on get/setNetworkLocation.

      Thanks Tsz-wo Sze for the offline disscussion.

        Attachments

        1. HDFS-11409.001.patch
          1 kB
          Chen Liang

          Issue Links

            Activity

              People

              • Assignee:
                vagarychen Chen Liang
                Reporter:
                vagarychen Chen Liang
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: