## 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**)


[ Full content available at: https://github.com/apache/flink/pull/6737 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to