[
https://issues.apache.org/jira/browse/FLINK-10057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16654926#comment-16654926
]
ASF GitHub Bot commented on FLINK-10057:
----------------------------------------
GJL commented on issue #6491: [FLINK-10057] Update FlinkYarnSessionCli.java
URL: https://github.com/apache/flink/pull/6491#issuecomment-430941464
Merging because all comments from @StefanRRichter have been addressed.
Here are some additional remarks:
* `isYarnPropertiesFileMode` is not in the performance critical path, and
there are not many options to be processed. Therefore, the method should be
optimized for readability.
* Your changes improve readability but we could do better by extracting the
logic in the loop, e.g.,:
```
private boolean isYarnPropertiesFileMode(CommandLine commandLine) {
final boolean isNotAddressOptionSet =
!commandLine.hasOption(addressOption.getOpt());
return isNotAddressOptionSet &&
isNotYarnOptionsSet(commandLine);
}
```
* Please respect the commit [message
guidelines](https://flink.apache.org/contribute-code.html#coding-guidelines):
> Commit message. A pull request must relate to a Jira issue; create an
issue if none exists for the change you want to make. The latest commit message
should reference that issue. An example commit message would be [FLINK-633] Fix
NullPointerException for empty UDF parameters. That way, the pull request
automatically gives a description of what it does, for example, what bug does
it fix in what way.
----------------------------------------------------------------
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:
[email protected]
> 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)