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

DatanodeInfo getNetworkLocation and setNetworkLocation shoud use volatile instead of synchronized

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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 Tsz-wo Sze for the offline disscussion.

      Attachments

        1. HDFS-11409.001.patch
          1 kB
          Chen Liang

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment