hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "weiyuan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-6799) Remove the duplicated code in CGroupsHandlerImp.java
Date Mon, 11 Sep 2017 06:39:00 GMT

    [ https://issues.apache.org/jira/browse/YARN-6799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16160798#comment-16160798
] 

weiyuan commented on YARN-6799:
-------------------------------

[~yufeigu], thanks for your help!

> Remove the duplicated code in CGroupsHandlerImp.java
> ----------------------------------------------------
>
>                 Key: YARN-6799
>                 URL: https://issues.apache.org/jira/browse/YARN-6799
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: nodemanager
>    Affects Versions: 3.0.0-alpha3
>            Reporter: Yufei Gu
>            Assignee: weiyuan
>            Priority: Trivial
>             Fix For: 2.9.0, 3.0.0-beta1
>
>         Attachments: YARN-6799.001.patch, YARN-6799.002.patch
>
>
> The else clause in initializeCGroupController is not necessary.
> {code}
>   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));
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org


Mime
View raw message