public abstract class AbstractYarnClient extends java.lang.Object implements YarnClient, InitializingBean
YarnClient.| Constructor and Description |
|---|
AbstractYarnClient(ClientRmOperations clientRmOperations)
Constructs client with a given template.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
ApplicationReport |
getApplicationReport(ApplicationId applicationId)
Gets a report of the application.
|
ClientRmOperations |
getClientRmOperations()
Gets the client rm operations.
|
Configuration |
getConfiguration()
Get the
Configuration of this client. |
java.util.Map<java.lang.String,java.lang.String> |
getEnvironment()
Gets the environment variables.
|
protected ContainerLaunchContext |
getMasterContainerLaunchContext()
Gets the master container launch context.
|
protected Path |
getStagingPath()
Gets the staging path.
|
protected ApplicationSubmissionContext |
getSubmissionContext(ApplicationId applicationId)
Gets the submission context for application master.
|
void |
installApplication()
Installs the application known to
YarnClient instance into hdfs. |
void |
killApplication(ApplicationId applicationId)
Requests a resource manager to kill the application.
|
java.util.List<ApplicationReport> |
listApplications()
Gets a list of known applications.
|
java.util.List<ApplicationReport> |
listApplications(java.lang.String type)
Gets a list of known applications filtered by an application type.
|
java.util.List<ApplicationReport> |
listRunningApplications(java.lang.String type)
Gets a list of running applications filtered by an application type.
|
void |
setApplicationDirName(java.lang.String applicationDirName)
Sets the application dir name.
|
void |
setAppName(java.lang.String appName)
Sets the name for submitted application.
|
void |
setAppType(java.lang.String appType)
Sets the type for submitted application.
|
void |
setClientRmOperations(ClientRmOperations clientRmOperations)
Sets the
ClientRmOperations implementation for
accessing resource manager. |
void |
setCommands(java.util.List<java.lang.String> commands)
Sets the commands starting appmaster.
|
void |
setConfiguration(Configuration configuration)
Sets the Yarn configuration.
|
void |
setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
Sets the environment for appmaster.
|
void |
setMemory(int memory)
Sets the memory.
|
void |
setPriority(int priority)
Sets the priority.
|
void |
setQueue(java.lang.String queue)
Sets the queue.
|
void |
setResourceLocalizer(ResourceLocalizer resourceLocalizer)
Sets the resource localizer for appmaster container.
|
void |
setStagingDirPath(java.lang.String stagingDirPath)
Sets the staging dir path.
|
void |
setVirtualcores(int virtualcores)
Sets the virtualcores.
|
ApplicationId |
submitApplication()
Submits the application known to
YarnClient instance. |
ApplicationId |
submitApplication(boolean distribute)
Submits the application known to
YarnClient instance. |
public AbstractYarnClient(ClientRmOperations clientRmOperations)
clientRmOperations - the client to resource manager templatepublic void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface InitializingBeanjava.lang.Exceptionpublic ApplicationId submitApplication()
YarnClientYarnClient instance.submitApplication in interface YarnClientApplicationId for submitted applicationpublic ApplicationId submitApplication(boolean distribute)
YarnClientYarnClient instance.submitApplication in interface YarnClientdistribute - if set to true files will also be copiedApplicationId for submitted applicationpublic void installApplication()
YarnClientYarnClient instance into hdfs.installApplication in interface YarnClientpublic void killApplication(ApplicationId applicationId)
YarnClientkillApplication in interface YarnClientapplicationId - the ApplicationIdpublic java.util.List<ApplicationReport> listApplications()
YarnClientlistApplications in interface YarnClientApplicationReportspublic java.util.List<ApplicationReport> listApplications(java.lang.String type)
YarnClientlistApplications in interface YarnClienttype - the yarn application typeApplicationReportspublic java.util.List<ApplicationReport> listRunningApplications(java.lang.String type)
YarnClientlistRunningApplications in interface YarnClienttype - the yarn application typeApplicationReportspublic ApplicationReport getApplicationReport(ApplicationId applicationId)
YarnClientgetApplicationReport in interface YarnClientapplicationId - the application idApplicationReportpublic void setClientRmOperations(ClientRmOperations clientRmOperations)
ClientRmOperations implementation for
accessing resource manager.clientRmOperations - The client to resource manager implementationpublic ClientRmOperations getClientRmOperations()
public java.util.Map<java.lang.String,java.lang.String> getEnvironment()
public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
environment - the environmentpublic void setCommands(java.util.List<java.lang.String> commands)
commands - the commands starting appmasterpublic Configuration getConfiguration()
Configuration of this client. Internally
this method is called to get the configuration which
allows sub-classes to override and add additional settings.Configurationpublic void setConfiguration(Configuration configuration)
configuration - the Yarn configurationpublic void setResourceLocalizer(ResourceLocalizer resourceLocalizer)
resourceLocalizer - the new resource localizerpublic void setAppName(java.lang.String appName)
appName - the new application namepublic void setAppType(java.lang.String appType)
appType - the new application typepublic void setPriority(int priority)
priority - the new prioritypublic void setVirtualcores(int virtualcores)
virtualcores - the new virtualcorespublic void setMemory(int memory)
memory - the new memorypublic void setQueue(java.lang.String queue)
queue - the new queuepublic void setStagingDirPath(java.lang.String stagingDirPath)
stagingDirPath - the new staging dir pathpublic void setApplicationDirName(java.lang.String applicationDirName)
applicationDirName - the new application dir nameprotected Path getStagingPath()
protected ApplicationSubmissionContext getSubmissionContext(ApplicationId applicationId)
applicationId - application idprotected ContainerLaunchContext getMasterContainerLaunchContext()