[ 
https://issues.apache.org/jira/browse/YARN-679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Steve Loughran updated YARN-679:
--------------------------------

    Attachment: YARN-679-002.patch

This (big) patch provides the service launcher with 
# a {{ServiceLauncher}} class to load and execute any service
# a new {{LaunchableService extends Service}} interface that adds two methods: 
{{bindArgs()}} and {{execute()}}, to bind the CLI args and to execute the 
service. This improves service integration with the launcher, *but is not 
mandatory*. Any service with an empty or string constructor can be launched. 
# Signal hooking for best-effort shutdown
# an exception handling model which allows any exception to generate a return 
code.
# a standard set of return codes {{LauncherExitCodes}}
# changes to ExitUtil to improve its ability to exit with given exit codes and 
messages.
# lots and lots of tests
# lots and lots of javadocs.

The javadocs provide the most information; after a {{mvn javadoc:javadoc}} run, 
look in 
{{hadoop-common-project/hadoop-common/target/site/api/org/apache/hadoop/service/launcher/package-summary.html}}

This is the service launcher we've been using for 8+ months, putting into 
hadoop common has consisted mainly of tests & javadocs, with some (long 
desired) enhancements to exit code handling (HADOOP-9626).

I have not -yet- made any changes to CLI processing. So far it doesn't do as 
much as tool runner. All it does is scan the CLI args list for {{--conf 
filename}} pairs, extracting configuration files from them and,  after testing, 
adds it to the configuration used to initialize the service.

If we want more, rather than try and get the (outdated) 
{{GenericOptionsParser}} to do the parsing, I'd prefer to write a 
JCommander-based alternative, with (most) of the same arguments, but more 
usable and extensible, and with its own tests. I've been using JCommander and 
an familiar with its features and quirks now.

> add an entry point that can start any Yarn service
> --------------------------------------------------
>
>                 Key: YARN-679
>                 URL: https://issues.apache.org/jira/browse/YARN-679
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: api
>    Affects Versions: 2.4.0
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>         Attachments: YARN-679-001.patch, YARN-679-002.patch
>
>
> There's no need to write separate .main classes for every Yarn service, given 
> that the startup mechanism should be identical: create, init, start, wait for 
> stopped -with an interrupt handler to trigger a clean shutdown on a control-c 
> interrrupt.
> Provide one that takes any classname, and a list of config files/options



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to