Skip to content

Conversation

@rice668
Copy link

@rice668 rice668 commented Jan 27, 2018

What is the purpose of the change

Add a proper command line parsing tool to the entry point of the TaskManagerRunner#main.

Brief change log

  • Use Commons CLI as tool to implement this functionality.
  • Remove the original way of ParameterTool.

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

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): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (don't know)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (JavaDocs)

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @zhangminglei. I think you have to revisit which options are registered in order to parse the configDir parameter. Please also write a test to verify your changes.

CommandLineParser parser = new DefaultParser();
CommandLine cmd = parser.parse(ALL_OPTIONS, args);

final String configDir = cmd.getOptionValue("configDir");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried whether this actually works? It looks to me as if this will always return null. Please write a test for it.

@rice668
Copy link
Author

rice668 commented Jan 30, 2018

Thanks @tillrohrmann . I will take a look based on your suggestions.

@rice668
Copy link
Author

rice668 commented Jan 31, 2018

@tillrohrmann It seems that now there is not any Option be registered for later parse the configDir parameter I just checked. I either register the configDir parameter in somewhere, such as in CliFrontendParser class or directly use TaskManager.parseArgsAndLoadConfig(args); to get Configuration. What do you think of this ? @tillrohrmann Thanks.

@rice668
Copy link
Author

rice668 commented Jan 31, 2018

I have updated the code and write a test. @tillrohrmann Thanks in advance to review those codes ~

@tillrohrmann
Copy link
Contributor

Sorry for not getting back to you earlier @zhangminglei. I accidentally addressed this issue with #6318. I think we can therefore close this PR.

Sorry for the bad PR management. This won't happen again.

@rice668
Copy link
Author

rice668 commented Jul 13, 2018

Hi, @tillrohrmann . You are welcome ~ I still have a lot of other flink jira will be addressed by me in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants