Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Introduce an AutoCloseableLock class that is a thin wrapper over RentrantLock. It allows using RentrantLock with try-with-resources syntax.

      The wrapper functions perform no expensive operations in the lock acquire/release path.

      1. HADOOP-13466.001.patch
        5 kB
        Chen Liang
      2. HADOOP-13466.002.patch
        8 kB
        Chen Liang

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #10217 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10217/)
        HADOOP-13466. Add an AutoCloseableLock class. (Chen Liang) (arp: rev 331ef251527f2cb7f1bfa8e1b745b889e538e8a0)

        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestAutoCloseableLock.java
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/AutoCloseableLock.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #10217 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10217/ ) HADOOP-13466 . Add an AutoCloseableLock class. (Chen Liang) (arp: rev 331ef251527f2cb7f1bfa8e1b745b889e538e8a0) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestAutoCloseableLock.java hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/AutoCloseableLock.java
        Hide
        arpitagarwal Arpit Agarwal added a comment -

        The test failure is unrelated. Committed for 2.8.0.

        Thanks for the contribution Chen Liang!

        Show
        arpitagarwal Arpit Agarwal added a comment - The test failure is unrelated. Committed for 2.8.0. Thanks for the contribution Chen Liang !
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 11s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
        +1 mvninstall 7m 30s trunk passed
        +1 compile 7m 12s trunk passed
        +1 checkstyle 0m 22s trunk passed
        +1 mvnsite 0m 57s trunk passed
        +1 mvneclipse 0m 12s trunk passed
        +1 findbugs 1m 28s trunk passed
        +1 javadoc 0m 48s trunk passed
        +1 mvninstall 0m 40s the patch passed
        +1 compile 7m 17s the patch passed
        +1 javac 7m 17s the patch passed
        +1 checkstyle 0m 23s the patch passed
        +1 mvnsite 0m 54s the patch passed
        +1 mvneclipse 0m 12s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 32s the patch passed
        +1 javadoc 0m 46s the patch passed
        -1 unit 18m 10s hadoop-common in the patch failed.
        +1 asflicense 0m 19s The patch does not generate ASF License warnings.
        50m 21s



        Reason Tests
        Timed out junit tests org.apache.hadoop.http.TestHttpServerLifecycle



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12822122/HADOOP-13466.002.patch
        JIRA Issue HADOOP-13466
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 42929eed3b03 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / b8ca84a
        Default Java 1.8.0_101
        findbugs v3.0.0
        unit https://builds.apache.org/job/PreCommit-HADOOP-Build/10178/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10178/testReport/
        modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10178/console
        Powered by Apache Yetus 0.4.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 11s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 30s trunk passed +1 compile 7m 12s trunk passed +1 checkstyle 0m 22s trunk passed +1 mvnsite 0m 57s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 28s trunk passed +1 javadoc 0m 48s trunk passed +1 mvninstall 0m 40s the patch passed +1 compile 7m 17s the patch passed +1 javac 7m 17s the patch passed +1 checkstyle 0m 23s the patch passed +1 mvnsite 0m 54s the patch passed +1 mvneclipse 0m 12s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 32s the patch passed +1 javadoc 0m 46s the patch passed -1 unit 18m 10s hadoop-common in the patch failed. +1 asflicense 0m 19s The patch does not generate ASF License warnings. 50m 21s Reason Tests Timed out junit tests org.apache.hadoop.http.TestHttpServerLifecycle Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12822122/HADOOP-13466.002.patch JIRA Issue HADOOP-13466 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 42929eed3b03 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / b8ca84a Default Java 1.8.0_101 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HADOOP-Build/10178/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10178/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10178/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        arpitagarwal Arpit Agarwal added a comment - - edited

        Thanks Chen Liang. Actually never mind, I think this text is fine to have.

        +1 pending Jenkins result on the v2 patch.

        Show
        arpitagarwal Arpit Agarwal added a comment - - edited Thanks Chen Liang . Actually never mind, I think this text is fine to have. +1 pending Jenkins result on the v2 patch.
        Hide
        vagarychen Chen Liang added a comment -

        More docs added for the methods. And failed tests as in previous patch were unrelated.

        Show
        vagarychen Chen Liang added a comment - More docs added for the methods. And failed tests as in previous patch were unrelated.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 20s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
        +1 mvninstall 7m 37s trunk passed
        +1 compile 6m 53s trunk passed
        +1 checkstyle 0m 23s trunk passed
        +1 mvnsite 0m 54s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 1m 18s trunk passed
        +1 javadoc 0m 44s trunk passed
        +1 mvninstall 0m 37s the patch passed
        +1 compile 6m 42s the patch passed
        +1 javac 6m 42s the patch passed
        -0 checkstyle 0m 22s hadoop-common-project/hadoop-common: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
        +1 mvnsite 0m 52s the patch passed
        +1 mvneclipse 0m 12s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 25s the patch passed
        +1 javadoc 0m 45s the patch passed
        -1 unit 7m 35s hadoop-common in the patch failed.
        +1 asflicense 0m 21s The patch does not generate ASF License warnings.
        38m 39s



        Reason Tests
        Failed junit tests hadoop.metrics2.impl.TestGangliaMetrics



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12821932/HADOOP-13466.001.patch
        JIRA Issue HADOOP-13466
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux c8fdffc05d45 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / a1f6564
        Default Java 1.8.0_101
        findbugs v3.0.0
        checkstyle https://builds.apache.org/job/PreCommit-HADOOP-Build/10170/artifact/patchprocess/diff-checkstyle-hadoop-common-project_hadoop-common.txt
        unit https://builds.apache.org/job/PreCommit-HADOOP-Build/10170/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10170/testReport/
        modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10170/console
        Powered by Apache Yetus 0.4.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 20s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 37s trunk passed +1 compile 6m 53s trunk passed +1 checkstyle 0m 23s trunk passed +1 mvnsite 0m 54s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 18s trunk passed +1 javadoc 0m 44s trunk passed +1 mvninstall 0m 37s the patch passed +1 compile 6m 42s the patch passed +1 javac 6m 42s the patch passed -0 checkstyle 0m 22s hadoop-common-project/hadoop-common: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0) +1 mvnsite 0m 52s the patch passed +1 mvneclipse 0m 12s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 25s the patch passed +1 javadoc 0m 45s the patch passed -1 unit 7m 35s hadoop-common in the patch failed. +1 asflicense 0m 21s The patch does not generate ASF License warnings. 38m 39s Reason Tests Failed junit tests hadoop.metrics2.impl.TestGangliaMetrics Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12821932/HADOOP-13466.001.patch JIRA Issue HADOOP-13466 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux c8fdffc05d45 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / a1f6564 Default Java 1.8.0_101 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-HADOOP-Build/10170/artifact/patchprocess/diff-checkstyle-hadoop-common-project_hadoop-common.txt unit https://builds.apache.org/job/PreCommit-HADOOP-Build/10170/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10170/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10170/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        vagarychen Chen Liang added a comment -

        Thanks Arpit Agarwal for the review and the suggestion! Will upload another patch with more Javadocs.

        Show
        vagarychen Chen Liang added a comment - Thanks Arpit Agarwal for the review and the suggestion! Will upload another patch with more Javadocs.
        Hide
        arpitagarwal Arpit Agarwal added a comment -

        +1 pending Jenkins. Thanks Chen Liang for splitting out this reusable class from the HDFS changes. The unit tests also look good!

        Separately we can add Javadocs to the AutoCloseableLock methods since a lock class should make its contract explicit.

        Show
        arpitagarwal Arpit Agarwal added a comment - +1 pending Jenkins. Thanks Chen Liang for splitting out this reusable class from the HDFS changes. The unit tests also look good! Separately we can add Javadocs to the AutoCloseableLock methods since a lock class should make its contract explicit.
        Hide
        vagarychen Chen Liang added a comment -

        An initial patch added.

        Show
        vagarychen Chen Liang added a comment - An initial patch added.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development