hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wei-Chiu Chuang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-6885) AllocationFileLoaderService.loadQueue() should use a switch statement in the main tag parsing loop instead of the if/else-if/...
Date Sat, 19 Aug 2017 03:26:00 GMT

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

Wei-Chiu Chuang commented on YARN-6885:
---------------------------------------

Looks like codestyle doesn't like nested blocks in switch-case. :)

Found some nits, mostly code style:

Please make sure 
{code}
case "maxAMShare":
      {
        String text = ((Text)field.getFirstChild()).getData().trim();
        Float val = Float.parseFloat(text);
        val = Math.min(val, 1.0f);
        queueMaxAMShares.put(queueName, (Float)val);
{code}
(Float) is redundant.



> AllocationFileLoaderService.loadQueue() should use a switch statement in the main tag
parsing loop instead of the if/else-if/...
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: YARN-6885
>                 URL: https://issues.apache.org/jira/browse/YARN-6885
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: fairscheduler
>    Affects Versions: 3.0.0-alpha4
>            Reporter: Daniel Templeton
>            Assignee: Yu-Tang Lin
>            Priority: Minor
>              Labels: newbie
>             Fix For: 3.0.0-alpha4
>
>         Attachments: YARN-6885.005.patch, YARN-6885.006.patch, YARN-6885.007.patch
>
>
> {code}      if ("minResources".equals(field.getTagName())) {
>         String text = ((Text)field.getFirstChild()).getData().trim();
>         Resource val =
>             FairSchedulerConfiguration.parseResourceConfigValue(text);
>         minQueueResources.put(queueName, val);
>       } else if ("maxResources".equals(field.getTagName())) {
>       ...{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