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

DatanodeInfo getNetworkLocation and setNetworkLocation shoud use volatile instead of synchronized

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-alpha4
    • 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 Nicholas Sze for the offline disscussion.

        Activity

        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 18s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 mvninstall 13m 11s trunk passed
        +1 compile 0m 35s trunk passed
        +1 checkstyle 0m 16s trunk passed
        +1 mvnsite 0m 38s trunk passed
        +1 mvneclipse 0m 12s trunk passed
        +1 findbugs 1m 35s trunk passed
        +1 javadoc 0m 25s trunk passed
        +1 mvninstall 0m 38s the patch passed
        +1 compile 0m 31s the patch passed
        +1 javac 0m 31s the patch passed
        -0 checkstyle 0m 13s hadoop-hdfs-project/hadoop-hdfs-client: The patch generated 3 new + 58 unchanged - 3 fixed = 61 total (was 61)
        +1 mvnsite 0m 36s the patch passed
        +1 mvneclipse 0m 11s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 46s the patch passed
        +1 javadoc 0m 22s the patch passed
        +1 unit 1m 3s hadoop-hdfs-client in the patch passed.
        +1 asflicense 0m 20s The patch does not generate ASF License warnings.
        24m 13s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue HDFS-11409
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12852445/HDFS-11409.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 5015f7c1c34d 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 71c23c9
        Default Java 1.8.0_121
        findbugs v3.0.0
        checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/18361/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-client.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/18361/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/18361/console
        Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 18s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 13m 11s trunk passed +1 compile 0m 35s trunk passed +1 checkstyle 0m 16s trunk passed +1 mvnsite 0m 38s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 35s trunk passed +1 javadoc 0m 25s trunk passed +1 mvninstall 0m 38s the patch passed +1 compile 0m 31s the patch passed +1 javac 0m 31s the patch passed -0 checkstyle 0m 13s hadoop-hdfs-project/hadoop-hdfs-client: The patch generated 3 new + 58 unchanged - 3 fixed = 61 total (was 61) +1 mvnsite 0m 36s the patch passed +1 mvneclipse 0m 11s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 46s the patch passed +1 javadoc 0m 22s the patch passed +1 unit 1m 3s hadoop-hdfs-client in the patch passed. +1 asflicense 0m 20s The patch does not generate ASF License warnings. 24m 13s Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue HDFS-11409 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12852445/HDFS-11409.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 5015f7c1c34d 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 71c23c9 Default Java 1.8.0_121 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/18361/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-client.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/18361/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client Console output https://builds.apache.org/job/PreCommit-HDFS-Build/18361/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        +1 patch looks good.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - +1 patch looks good.
        Hide
        brahmareddy Brahma Reddy Battula added a comment -

        Me too +1. I feel, check-style can be ignored as rest of methods are same format in DatanodeInfo.java.

        Show
        brahmareddy Brahma Reddy Battula added a comment - Me too +1. I feel, check-style can be ignored as rest of methods are same format in DatanodeInfo.java .
        Hide
        xyao Xiaoyu Yao added a comment -

        +1. I will commit the patch soon.

        Show
        xyao Xiaoyu Yao added a comment - +1. I will commit the patch soon.
        Hide
        xyao Xiaoyu Yao added a comment -

        Thanks Chen Liang for the contribution and all for the reviews. I've commit the patch to trunk and branch-2.

        Show
        xyao Xiaoyu Yao added a comment - Thanks Chen Liang for the contribution and all for the reviews. I've commit the patch to trunk and branch-2.
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Jenkins build Hadoop-trunk-Commit #11247 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11247/)
        HDFS-11409. DatanodeInfo getNetworkLocation and setNetworkLocation shoud (xyao: rev aaf27132350547fcde1fdb372f19626838f44bc4)

        • (edit) hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Jenkins build Hadoop-trunk-Commit #11247 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11247/ ) HDFS-11409 . DatanodeInfo getNetworkLocation and setNetworkLocation shoud (xyao: rev aaf27132350547fcde1fdb372f19626838f44bc4) (edit) hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        Great! Chen Liang, thanks for working on this. Brahma Reddy Battula, thanks for reviewing the patch. Xiaoyu Yao, thanks for committing it.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - Great! Chen Liang , thanks for working on this. Brahma Reddy Battula , thanks for reviewing the patch. Xiaoyu Yao , thanks for committing it.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development