public class ClientRmTemplate extends YarnRpcAccessor<org.apache.hadoop.yarn.api.ApplicationClientProtocol> implements ClientRmOperations
ClientRmOperations
wrapping
communication using ApplicationClientProtocol
. Methods for this
template wraps possible exceptions into Spring Dao exception hierarchy.Constructor and Description |
---|
ClientRmTemplate(org.apache.hadoop.conf.Configuration config)
Constructs a
ClientRmTemplate with a given yarn configuration. |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.yarn.api.records.ApplicationReport |
getApplicationReport(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
Gets a report of the application.
|
org.apache.hadoop.yarn.api.records.Token |
getDelegationToken(java.lang.String renewer)
Gets the resource manager delegation token.
|
org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationResponse |
getNewApplication()
Requests a new application from a resource manager.
|
protected java.net.InetSocketAddress |
getRpcAddress(org.apache.hadoop.conf.Configuration config)
Gets the
InetSocketAddress where this accessor should connect. |
org.apache.hadoop.yarn.api.protocolrecords.KillApplicationResponse |
killApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
Requests
ResourceManager to abort submitted application. |
java.util.List<org.apache.hadoop.yarn.api.records.ApplicationReport> |
listApplications()
Gets a list of
ApplicationReport s from a resource manager. |
java.util.List<org.apache.hadoop.yarn.api.records.ApplicationReport> |
listApplications(java.util.EnumSet<org.apache.hadoop.yarn.api.records.YarnApplicationState> states,
java.util.Set<java.lang.String> types)
Gets a list of
ApplicationReport s from a resource manager. |
org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationResponse |
submitApplication(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubContext)
Submits a new application into resource manager.
|
afterPropertiesSet, createProxy, destroy, execute, getConfiguration, getProxy, getUser
public ClientRmTemplate(org.apache.hadoop.conf.Configuration config)
ClientRmTemplate
with a given yarn configuration.config
- the yarn configurationpublic java.util.List<org.apache.hadoop.yarn.api.records.ApplicationReport> listApplications(java.util.EnumSet<org.apache.hadoop.yarn.api.records.YarnApplicationState> states, java.util.Set<java.lang.String> types)
ClientRmOperations
ApplicationReport
s from a resource manager. Allows
to filter results by using a set of YarnApplicationState
s and
registered application types.listApplications
in interface ClientRmOperations
states
- the yarn application statestypes
- the yarn application typesApplicationReport
spublic java.util.List<org.apache.hadoop.yarn.api.records.ApplicationReport> listApplications()
ClientRmOperations
ApplicationReport
s from a resource manager.listApplications
in interface ClientRmOperations
ApplicationReport
spublic org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationResponse getNewApplication()
ClientRmOperations
ApplicationId
but response
also contains information about resource capabilities.getNewApplication
in interface ClientRmOperations
GetNewApplicationResponse
public org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationResponse submitApplication(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubContext)
ClientRmOperations
submitApplication
in interface ClientRmOperations
appSubContext
- the Application Submission ContextSubmitApplicationResponse
public org.apache.hadoop.yarn.api.protocolrecords.KillApplicationResponse killApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
ClientRmOperations
ResourceManager
to abort submitted application.killApplication
in interface ClientRmOperations
applicationId
- the application idKillApplicationResponse
public org.apache.hadoop.yarn.api.records.Token getDelegationToken(java.lang.String renewer)
ClientRmOperations
getDelegationToken
in interface ClientRmOperations
renewer
- the renewer as kerberos principalpublic org.apache.hadoop.yarn.api.records.ApplicationReport getApplicationReport(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
ClientRmOperations
getApplicationReport
in interface ClientRmOperations
applicationId
- the application idApplicationReport
protected java.net.InetSocketAddress getRpcAddress(org.apache.hadoop.conf.Configuration config)
YarnRpcAccessor
InetSocketAddress
where this accessor should connect.getRpcAddress
in class YarnRpcAccessor<org.apache.hadoop.yarn.api.ApplicationClientProtocol>
config
- the yarn configuration