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

DatanodeInfo getNetworkLocation and setNetworkLocation shoud use volatile instead of synchronized

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.9.0, 3.0.0-alpha4, 2.8.4
    • performance
    • None
    • 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 szetszwo for the offline disscussion.

      Attachments

        1. HDFS-11409.001.patch
          1 kB
          Chen Liang

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: