Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-6799

Remove the duplicated code in CGroupsHandlerImp.java

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha3
    • Fix Version/s: 2.9.0, 3.0.0-beta1
    • Component/s: nodemanager
    • Labels:
      None

      Description

      The else clause in initializeCGroupController is not necessary.

        public void initializeCGroupController(CGroupController controller) throws
            ResourceHandlerException {
          if (enableCGroupMount) {
            // We have a controller that needs to be mounted
            mountCGroupController(controller);
          } else {
            String controllerPath = getControllerPath(controller);
      
            if (controllerPath == null) {
              throw new ResourceHandlerException(
                  String.format("Controller %s not mounted."
                      + " You either need to mount it with %s"
                      + " or mount cgroups before launching Yarn",
                      controller.getName(), YarnConfiguration.
                      NM_LINUX_CONTAINER_CGROUPS_MOUNT));
            }
          }
      
          // We are working with a pre-mounted contoller
          // Make sure that Yarn cgroup hierarchy path exists
          initializePreMountedCGroupController(controller);
        }
      
        private void initializePreMountedCGroupController(CGroupController controller)
            throws ResourceHandlerException {
          // Check permissions to cgroup hierarchy and
          // create YARN cgroup if it does not exist, yet
          String controllerPath = getControllerPath(controller);
      
          if (controllerPath == null) {
            throw new ResourceHandlerException(
                String.format("Controller %s not mounted."
                        + " You either need to mount it with %s"
                        + " or mount cgroups before launching Yarn",
                    controller.getName(), YarnConfiguration.
                        NM_LINUX_CONTAINER_CGROUPS_MOUNT));
          }
      
      1. YARN-6799.001.patch
        2 kB
        weiyuan
      2. YARN-6799.002.patch
        2 kB
        weiyuan

        Activity

        Hide
        yufeigu Yufei Gu added a comment -

        Committed to branch-3.0.

        Show
        yufeigu Yufei Gu added a comment - Committed to branch-3.0.
        Hide
        v123582 weiyuan added a comment -

        Yufei Gu, thanks for your help!

        Show
        v123582 weiyuan added a comment - Yufei Gu , thanks for your help!
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #12832 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12832/)
        YARN-6799. Remove the duplicated code in CGroupsHandlerImp.java. (yufei: rev 5ab21dfe9c8e14585db71e02bcb021a526507f98)

        • (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/CGroupsHandlerImpl.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #12832 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12832/ ) YARN-6799 . Remove the duplicated code in CGroupsHandlerImp.java. (yufei: rev 5ab21dfe9c8e14585db71e02bcb021a526507f98) (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/CGroupsHandlerImpl.java
        Hide
        yufeigu Yufei Gu added a comment -

        +1. Committed to trunk and branch-2. Thanks for the patch, weiyuan.

        Show
        yufeigu Yufei Gu added a comment - +1. Committed to trunk and branch-2. Thanks for the patch, weiyuan .
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 18s Docker mode activated.
              Prechecks
        +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.
              trunk Compile Tests
        +1 mvninstall 13m 43s trunk passed
        +1 compile 0m 43s trunk passed
        +1 checkstyle 0m 19s trunk passed
        +1 mvnsite 0m 29s trunk passed
        -1 findbugs 0m 43s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager in trunk has 1 extant Findbugs warnings.
        +1 javadoc 0m 18s trunk passed
              Patch Compile Tests
        +1 mvninstall 0m 25s the patch passed
        +1 compile 0m 40s the patch passed
        +1 javac 0m 40s the patch passed
        +1 checkstyle 0m 15s the patch passed
        +1 mvnsite 0m 26s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 0m 48s the patch passed
        +1 javadoc 0m 15s the patch passed
              Other Tests
        +1 unit 13m 38s hadoop-yarn-server-nodemanager in the patch passed.
        +1 asflicense 0m 15s The patch does not generate ASF License warnings.
        34m 30s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:71bbb86
        JIRA Issue YARN-6799
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12886259/YARN-6799.002.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 178399ce6a32 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 180e814
        Default Java 1.8.0_144
        findbugs v3.1.0-RC1
        findbugs https://builds.apache.org/job/PreCommit-YARN-Build/17387/artifact/patchprocess/branch-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-nodemanager-warnings.html
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/17387/testReport/
        modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/17387/console
        Powered by Apache Yetus 0.6.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.       Prechecks +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.       trunk Compile Tests +1 mvninstall 13m 43s trunk passed +1 compile 0m 43s trunk passed +1 checkstyle 0m 19s trunk passed +1 mvnsite 0m 29s trunk passed -1 findbugs 0m 43s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager in trunk has 1 extant Findbugs warnings. +1 javadoc 0m 18s trunk passed       Patch Compile Tests +1 mvninstall 0m 25s the patch passed +1 compile 0m 40s the patch passed +1 javac 0m 40s the patch passed +1 checkstyle 0m 15s the patch passed +1 mvnsite 0m 26s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 0m 48s the patch passed +1 javadoc 0m 15s the patch passed       Other Tests +1 unit 13m 38s hadoop-yarn-server-nodemanager in the patch passed. +1 asflicense 0m 15s The patch does not generate ASF License warnings. 34m 30s Subsystem Report/Notes Docker Image:yetus/hadoop:71bbb86 JIRA Issue YARN-6799 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12886259/YARN-6799.002.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 178399ce6a32 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 180e814 Default Java 1.8.0_144 findbugs v3.1.0-RC1 findbugs https://builds.apache.org/job/PreCommit-YARN-Build/17387/artifact/patchprocess/branch-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-nodemanager-warnings.html Test Results https://builds.apache.org/job/PreCommit-YARN-Build/17387/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager Console output https://builds.apache.org/job/PreCommit-YARN-Build/17387/console Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        yufeigu Yufei Gu added a comment -

        Thanks for working on this. weiyuan. The findbugs is unrelated. The style issue is valid. Need to remove extra whitespace.

        Show
        yufeigu Yufei Gu added a comment - Thanks for working on this. weiyuan . The findbugs is unrelated. The style issue is valid. Need to remove extra whitespace.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 16s Docker mode activated.
              Prechecks
        +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.
              trunk Compile Tests
        +1 mvninstall 13m 40s trunk passed
        +1 compile 0m 43s trunk passed
        +1 checkstyle 0m 18s trunk passed
        +1 mvnsite 0m 30s trunk passed
        -1 findbugs 0m 51s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager in trunk has 1 extant Findbugs warnings.
        +1 javadoc 0m 18s trunk passed
              Patch Compile Tests
        +1 mvninstall 0m 26s the patch passed
        +1 compile 0m 40s the patch passed
        +1 javac 0m 40s the patch passed
        +1 checkstyle 0m 15s the patch passed
        +1 mvnsite 0m 26s the patch passed
        -1 whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply
        +1 findbugs 0m 48s the patch passed
        +1 javadoc 0m 15s the patch passed
              Other Tests
        +1 unit 13m 26s hadoop-yarn-server-nodemanager in the patch passed.
        +1 asflicense 0m 14s The patch does not generate ASF License warnings.
        34m 21s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:71bbb86
        JIRA Issue YARN-6799
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12885842/YARN-6799.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 74eb5775c313 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 5ff7416
        Default Java 1.8.0_144
        findbugs v3.1.0-RC1
        findbugs https://builds.apache.org/job/PreCommit-YARN-Build/17332/artifact/patchprocess/branch-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-nodemanager-warnings.html
        whitespace https://builds.apache.org/job/PreCommit-YARN-Build/17332/artifact/patchprocess/whitespace-eol.txt
        Test Results https://builds.apache.org/job/PreCommit-YARN-Build/17332/testReport/
        modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager
        Console output https://builds.apache.org/job/PreCommit-YARN-Build/17332/console
        Powered by Apache Yetus 0.6.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 16s Docker mode activated.       Prechecks +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.       trunk Compile Tests +1 mvninstall 13m 40s trunk passed +1 compile 0m 43s trunk passed +1 checkstyle 0m 18s trunk passed +1 mvnsite 0m 30s trunk passed -1 findbugs 0m 51s hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager in trunk has 1 extant Findbugs warnings. +1 javadoc 0m 18s trunk passed       Patch Compile Tests +1 mvninstall 0m 26s the patch passed +1 compile 0m 40s the patch passed +1 javac 0m 40s the patch passed +1 checkstyle 0m 15s the patch passed +1 mvnsite 0m 26s the patch passed -1 whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply +1 findbugs 0m 48s the patch passed +1 javadoc 0m 15s the patch passed       Other Tests +1 unit 13m 26s hadoop-yarn-server-nodemanager in the patch passed. +1 asflicense 0m 14s The patch does not generate ASF License warnings. 34m 21s Subsystem Report/Notes Docker Image:yetus/hadoop:71bbb86 JIRA Issue YARN-6799 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12885842/YARN-6799.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 74eb5775c313 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 5ff7416 Default Java 1.8.0_144 findbugs v3.1.0-RC1 findbugs https://builds.apache.org/job/PreCommit-YARN-Build/17332/artifact/patchprocess/branch-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-nodemanager-warnings.html whitespace https://builds.apache.org/job/PreCommit-YARN-Build/17332/artifact/patchprocess/whitespace-eol.txt Test Results https://builds.apache.org/job/PreCommit-YARN-Build/17332/testReport/ modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager Console output https://builds.apache.org/job/PreCommit-YARN-Build/17332/console Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        v123582 weiyuan added a comment -

        This patch is uploaded. Yufei Gu, do you have anything else to add? Thanks!

        Show
        v123582 weiyuan added a comment - This patch is uploaded. Yufei Gu , do you have anything else to add? Thanks!
        Hide
        yufeigu Yufei Gu added a comment -

        weiyuan, feel free to take it. Thanks for working on this.

        Show
        yufeigu Yufei Gu added a comment - weiyuan , feel free to take it. Thanks for working on this.
        Hide
        v123582 weiyuan added a comment -

        Hi, Yufei Gu, thanks for filling this form. I would like to try this issue, so I assigned it to me directly.

        Show
        v123582 weiyuan added a comment - Hi, Yufei Gu , thanks for filling this form. I would like to try this issue, so I assigned it to me directly.

          People

          • Assignee:
            v123582 weiyuan
            Reporter:
            yufeigu Yufei Gu
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development