hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Templeton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAPREDUCE-6825) YARNRunner#createApplicationSubmissionContext method is longer than 150 lines
Date Mon, 06 Feb 2017 17:38:42 GMT

    [ https://issues.apache.org/jira/browse/MAPREDUCE-6825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15854425#comment-15854425

Daniel Templeton commented on MAPREDUCE-6825:

Thanks, [~GergelyNovak].  Some comments:

{code}    warnForJavaLibPath(conf.get(MRJobConfig.MAPRED_MAP_ADMIN_JAVA_OPTS, ""),
    warnForJavaLibPath(conf.get(MRJobConfig.REDUCE_JAVA_OPTS, ""), "reduce",
        MRJobConfig.REDUCE_JAVA_OPTS, MRJobConfig.REDUCE_ENV);
    warnForJavaLibPath(conf.get(MRJobConfig.MAPRED_REDUCE_ADMIN_JAVA_OPTS, ""),

The first and third call have the same style regarding line breaks, but the second is different.
 May as well make them all consistent.

    Map<String, LocalResource> localResources =
        setupLocalResources(jobConf, jobSubmitDir);

    // Setup security tokens
    DataOutputBuffer dob = new DataOutputBuffer();
    ByteBuffer securityTokens = ByteBuffer.wrap(
        dob.getData(), 0, dob.getLength());

Similarly, {{localResources}} and {{securityTokens}} are split in different ways.  I prefer
to break the line on the equals, like {{localResources}}.

While you're messing with stuff, you may as well switch all the collections to use the diamond

And, while it's not your fault, the javadoc is missing for {{createApplicationSubmissionContext()}}.
 Could you please add it?

> YARNRunner#createApplicationSubmissionContext method is longer than 150 lines
> -----------------------------------------------------------------------------
>                 Key: MAPREDUCE-6825
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6825
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>            Reporter: Chris Trezzo
>            Assignee: Gergely Novák
>            Priority: Trivial
>              Labels: newbie
>         Attachments: MAPREDUCE-6825.001.patch, MAPREDUCE-6825.002.patch, MAPREDUCE-6825.003.patch
> bq. ./hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java:341:
public ApplicationSubmissionContext createApplicationSubmissionContext(:3: Method length is
249 lines (max allowed is 150).
> {{YARNRunner#createApplicationSubmissionContext}} is longer than 150 lines and needs
to be refactored.

This message was sent by Atlassian JIRA

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

View raw message