You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/09/23 08:00:00 UTC

[jira] [Commented] (FLINK-10399) Refractor ParameterTool#fromArgs

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

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

TisonKun opened a new pull request #6737: [FLINK-10399] Refractor ParameterTool#fromArgs
URL: https://github.com/apache/flink/pull/6737
 
 
   ## What is the purpose of the change
   
   This pull request is about a refractor of `ParameterTool#fromArgs`.
   
   Current `ParameterTool#fromArgs` uses a weird implement by which flink developer would fail to parse it fast.
   
   The main problem is that, when parse args, we always try to get a key-value pair, but the implement iterate by a for loop, thus introduce weird flag/mutable variable and branches.
   
   ## Brief change log
   
   Refractor `ParameterTool#fromArgs`. Use a index(int iterator) and while loop to replace the original for loop. Make it more clear for the purpose and reduce weird branches and flags.
   
   Place some `final` modifier where I cannot get the idea that the variable is `final` when look at it.
   
   ## Verifying this change
   
   `ParameterToolTest` should guard the refractor.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (**no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (**yes**, but only the implementation, the interface and behavior kept.)
     - The serializers: (**no**)
     - The runtime per-record code paths (performance sensitive): (**no**)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper:  (**no**)
     - The S3 file system connector:  (**no**)
   
   ## Documentation
   
     - Does this pull request introduce a new feature?  (**no**)
     - If yes, how is the feature documented? (**no**)
   

----------------------------------------------------------------
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


> Refractor ParameterTool#fromArgs
> --------------------------------
>
>                 Key: FLINK-10399
>                 URL: https://issues.apache.org/jira/browse/FLINK-10399
>             Project: Flink
>          Issue Type: Improvement
>          Components: Client
>    Affects Versions: 1.7.0
>            Reporter: tison
>            Assignee: tison
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.7.0
>
>
> {{ParameterTool#fromArgs}} uses a weird implement which flink developer would fail to parse it fast.
> The main problem is that, when parse args, we always try to get a key-value pair, but the implement iterate by a {{for}} loop, thus introduce weird flag/mutable variable and branches.



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