flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-10057) optimalize org.apache.flink.yarn.cli.FlinkYarnSessionCli.isYarnPropertiesFileMode
Date Tue, 11 Sep 2018 14:32:00 GMT

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

ASF GitHub Bot commented on FLINK-10057:
----------------------------------------

StefanRRichter commented on a change in pull request #6491: [FLINK-10057] Update FlinkYarnSessionCli.java
URL: https://github.com/apache/flink/pull/6491#discussion_r216691577
 
 

 ##########
 File path: flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java
 ##########
 @@ -530,6 +530,11 @@ protected Configuration applyCommandLineOptionsToConfiguration(CommandLine
comma
 	private boolean isYarnPropertiesFileMode(CommandLine commandLine) {
 		boolean canApplyYarnProperties = !commandLine.hasOption(addressOption.getOpt());
 
+		// if canApplyYarnProperties is false,return quickly !
+		if (!canApplyYarnProperties) {
+			return canApplyYarnProperties;
 
 Review comment:
   Maybe simplify to `return false` or even just wrap the loop in `if (canApplyYarnProperties)
{ }` so that there is just a single returning point.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> optimalize org.apache.flink.yarn.cli.FlinkYarnSessionCli.isYarnPropertiesFileMode
> ---------------------------------------------------------------------------------
>
>                 Key: FLINK-10057
>                 URL: https://issues.apache.org/jira/browse/FLINK-10057
>             Project: Flink
>          Issue Type: Improvement
>          Components: Client
>    Affects Versions: 1.5.2
>            Reporter: liuzq
>            Priority: Major
>              Labels: pull-request-available
>
> --------------in function : org.apache.flink.yarn.cli.FlinkYarnSessionCli.isYarnPropertiesFileMode
>  
> private boolean isYarnPropertiesFileMode(CommandLine commandLine) {
>  boolean canApplyYarnProperties = !commandLine.hasOption(addressOption.getOpt());
> *//if canApplyYarnProperties is false,return quickly !*
> *//this code is added by me*
>  *if(false==canApplyYarnProperties){*
>        *return canApplyYarnProperties;*
>  *}*
> for (Option option : commandLine.getOptions()) {
>  if (allOptions.hasOption(option.getOpt())) {
>  if (!isDetachedOption(option)) {
> ...
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message