@InterfaceAudience.Public @InterfaceStability.Unstable public class Client extends Object
The distributed shell client allows an application master to be launched that in turn would run the provided shell command on a set of containers.
This client is meant to act as an example on how to write yarn-based applications.
To submit an application, a client first needs to connect to the
aka ApplicationsManager or ASM via the
provides a way for the client to get access to cluster information and to request for a
For the actual job submission, the client first has to create an
ApplicationSubmissionContext defines the application details such as
and application name, the priority assigned to the application and the queue
to which this application needs to be assigned. In addition to this, the
also defines the
ContainerLaunchContext which describes the
Container with which
ApplicationMaster is launched.
ContainerLaunchContext in this scenario defines the resources to be allocated for the
ApplicationMaster's container, the local resources (jars, configuration files) to be made available
and the environment to be set for the
ApplicationMaster and the commands to be executed to run the
ApplicationSubmissionContext, the client submits the application to the
ResourceManager and then monitors the application by requesting the
ApplicationReport at regular time intervals. In case of the application taking too long, the client
kills the application by submitting a
KillApplicationRequest to the
|Modifier and Type||Method and Description|
Parse command line options
Main run function for the client
public static void main(String args)
args- Command line arguments
public boolean init(String args) throws org.apache.commons.cli.ParseException
args- Parsed command line options
public boolean run() throws IOException, YarnException
protected void sendStopSignal()
Copyright © 2022 Apache Software Foundation. All rights reserved.