public class ClientRMService extends AbstractService implements ApplicationClientProtocol
Service.STATE
Modifier and Type | Field and Description |
---|---|
protected RMDelegationTokenSecretManager |
rmDTSecretManager |
Constructor and Description |
---|
ClientRMService(RMContext rmContext,
YarnScheduler scheduler,
RMAppManager rmAppManager,
ApplicationACLsManager applicationACLsManager,
QueueACLsManager queueACLsManager,
RMDelegationTokenSecretManager rmDTSecretManager) |
Modifier and Type | Method and Description |
---|---|
CancelDelegationTokenResponse |
cancelDelegationToken(CancelDelegationTokenRequest request)
Cancel an existing delegation
Token . |
KillApplicationResponse |
forceKillApplication(KillApplicationRequest request)
The interface used by clients to request the
ResourceManager to abort submitted application. |
GetApplicationReportResponse |
getApplicationReport(GetApplicationReportRequest request)
It gives response which includes application report if the application
present otherwise throws ApplicationNotFoundException.
|
GetApplicationsResponse |
getApplications(GetApplicationsRequest request)
The interface used by clients to get a report of Applications
matching the filters defined by
GetApplicationsRequest
in the cluster from the ResourceManager . |
InetSocketAddress |
getBindAddress() |
GetClusterMetricsResponse |
getClusterMetrics(GetClusterMetricsRequest request)
The interface used by clients to get metrics about the cluster from
the
ResourceManager . |
GetClusterNodesResponse |
getClusterNodes(GetClusterNodesRequest request)
The interface used by clients to get a report of all nodes
in the cluster from the
ResourceManager . |
GetDelegationTokenResponse |
getDelegationToken(GetDelegationTokenRequest request)
The interface used by clients to get delegation token, enabling the
containers to be able to talk to the service using those tokens.
|
GetNewApplicationResponse |
getNewApplication(GetNewApplicationRequest request)
The interface used by clients to obtain a new
ApplicationId for
submitting new applications. |
GetQueueInfoResponse |
getQueueInfo(GetQueueInfoRequest request)
The interface used by clients to get information about queues
from the
ResourceManager . |
GetQueueUserAclsInfoResponse |
getQueueUserAcls(GetQueueUserAclsInfoRequest request)
The interface used by clients to get information about queue
acls for current user from the
ResourceManager . |
RenewDelegationTokenResponse |
renewDelegationToken(RenewDelegationTokenRequest request)
Renew an existing delegation
Token . |
protected void |
serviceInit(Configuration conf)
All initialization code needed by a service.
|
protected void |
serviceStart()
Actions called during the INITED to STARTED transition.
|
protected void |
serviceStop()
Actions called during the transition to the STOPPED state.
|
SubmitApplicationResponse |
submitApplication(SubmitApplicationRequest request)
The interface used by clients to submit a new application to the
ResourceManager. |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
protected RMDelegationTokenSecretManager rmDTSecretManager
public ClientRMService(RMContext rmContext, YarnScheduler scheduler, RMAppManager rmAppManager, ApplicationACLsManager applicationACLsManager, QueueACLsManager queueACLsManager, RMDelegationTokenSecretManager rmDTSecretManager)
protected void serviceInit(Configuration conf) throws Exception
AbstractService
AbstractService.init(Configuration)
prevents re-entrancy.
The base implementation checks to see if the subclass has created
a new configuration instance, and if so, updates the base class valueserviceInit
in class AbstractService
conf
- configurationException
- on a failure -these will be caught,
possibly wrapped, and wil; trigger a service stopprotected void serviceStart() throws Exception
AbstractService
AbstractService.start()
prevents re-entrancy.serviceStart
in class AbstractService
Exception
- if needed -these will be caught,
wrapped, and trigger a service stopprotected void serviceStop() throws Exception
AbstractService
AbstractService.stop()
prevents re-entrancy.
Implementations MUST write this to be robust against failures, including
checks for null references -and for the first failure to not stop other
attempts to shut down parts of the service.serviceStop
in class AbstractService
Exception
- if needed -these will be caught and logged.@InterfaceAudience.Private public InetSocketAddress getBindAddress()
public GetNewApplicationResponse getNewApplication(GetNewApplicationRequest request) throws YarnException
ApplicationClientProtocol
The interface used by clients to obtain a new ApplicationId
for
submitting new applications.
The ResourceManager
responds with a new, monotonically
increasing, ApplicationId
which is used by the client to submit
a new application.
The ResourceManager
also responds with details such
as maximum resource capabilities in the cluster as specified in
GetNewApplicationResponse
.
getNewApplication
in interface ApplicationClientProtocol
request
- request to get a new ApplicationId
ApplicationId
to be used
to submit an applicationYarnException
ApplicationClientProtocol.submitApplication(SubmitApplicationRequest)
public GetApplicationReportResponse getApplicationReport(GetApplicationReportRequest request) throws YarnException
getApplicationReport
in interface ApplicationClientProtocol
request
- request for an application reportYarnException
public SubmitApplicationResponse submitApplication(SubmitApplicationRequest request) throws YarnException
ApplicationClientProtocol
The interface used by clients to submit a new application to the
ResourceManager.
The client is required to provide details such as queue,
Resource
required to run the ApplicationMaster
,
the equivalent of ContainerLaunchContext
for launching
the ApplicationMaster
etc. via the
SubmitApplicationRequest
.
Currently the ResourceManager
sends an immediate (empty)
SubmitApplicationResponse
on accepting the submission and throws
an exception if it rejects the submission. However, this call needs to be
followed by ApplicationClientProtocol.getApplicationReport(GetApplicationReportRequest)
to make sure that the application gets properly submitted.
In secure mode,the ResourceManager
verifies access to
queues etc. before accepting the application submission.
submitApplication
in interface ApplicationClientProtocol
request
- request to submit a new applicationYarnException
ApplicationClientProtocol.getNewApplication(GetNewApplicationRequest)
public KillApplicationResponse forceKillApplication(KillApplicationRequest request) throws YarnException
ApplicationClientProtocol
The interface used by clients to request the
ResourceManager
to abort submitted application.
The client, via KillApplicationRequest
provides the
ApplicationId
of the application to be aborted.
In secure mode,the ResourceManager
verifies access to the
application, queue etc. before terminating the application.
Currently, the ResourceManager
returns an empty response
on success and throws an exception on rejecting the request.
forceKillApplication
in interface ApplicationClientProtocol
request
- request to abort a submitted applicationResourceManager
returns an empty response
on success and throws an exception on rejecting the requestYarnException
ApplicationClientProtocol.getQueueUserAcls(GetQueueUserAclsInfoRequest)
public GetClusterMetricsResponse getClusterMetrics(GetClusterMetricsRequest request) throws YarnException
ApplicationClientProtocol
The interface used by clients to get metrics about the cluster from
the ResourceManager
.
The ResourceManager
responds with a
GetClusterMetricsResponse
which includes the
YarnClusterMetrics
with details such as number of current
nodes in the cluster.
getClusterMetrics
in interface ApplicationClientProtocol
request
- request for cluster metricsYarnException
public GetApplicationsResponse getApplications(GetApplicationsRequest request) throws YarnException
ApplicationClientProtocol
The interface used by clients to get a report of Applications
matching the filters defined by GetApplicationsRequest
in the cluster from the ResourceManager
.
The ResourceManager
responds with a
GetApplicationsResponse
which includes the
ApplicationReport
for the applications.
If the user does not have VIEW_APP
access for an
application then the corresponding report will be filtered as
described in ApplicationClientProtocol.getApplicationReport(GetApplicationReportRequest)
.
getApplications
in interface ApplicationClientProtocol
request
- request for report on applicationsYarnException
GetApplicationsRequest
public GetClusterNodesResponse getClusterNodes(GetClusterNodesRequest request) throws YarnException
ApplicationClientProtocol
The interface used by clients to get a report of all nodes
in the cluster from the ResourceManager
.
The ResourceManager
responds with a
GetClusterNodesResponse
which includes the
NodeReport
for all the nodes in the cluster.
getClusterNodes
in interface ApplicationClientProtocol
request
- request for report on all nodesYarnException
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request) throws YarnException
ApplicationClientProtocol
The interface used by clients to get information about queues
from the ResourceManager
.
The client, via GetQueueInfoRequest
, can ask for details such
as used/total resources, child queues, running applications etc.
In secure mode,the ResourceManager
verifies access before
providing the information.
getQueueInfo
in interface ApplicationClientProtocol
request
- request to get queue informationYarnException
public GetQueueUserAclsInfoResponse getQueueUserAcls(GetQueueUserAclsInfoRequest request) throws YarnException
ApplicationClientProtocol
The interface used by clients to get information about queue
acls for current user from the ResourceManager
.
The ResourceManager
responds with queue acls for all
existing queues.
getQueueUserAcls
in interface ApplicationClientProtocol
request
- request to get queue acls for current userYarnException
public GetDelegationTokenResponse getDelegationToken(GetDelegationTokenRequest request) throws YarnException
ApplicationClientProtocol
The interface used by clients to get delegation token, enabling the containers to be able to talk to the service using those tokens.
The ResourceManager
responds with the delegation
Token
that can be used by the client to speak to this
service.
getDelegationToken
in interface ApplicationClientProtocol
request
- request to get a delegation token for the client.YarnException
public RenewDelegationTokenResponse renewDelegationToken(RenewDelegationTokenRequest request) throws YarnException
ApplicationClientProtocol
Token
.renewDelegationToken
in interface ApplicationClientProtocol
request
- the delegation token to be renewed.YarnException
public CancelDelegationTokenResponse cancelDelegationToken(CancelDelegationTokenRequest request) throws YarnException
ApplicationClientProtocol
Token
.cancelDelegationToken
in interface ApplicationClientProtocol
request
- the delegation token to be cancelled.YarnException
Copyright © 2013 Apache Software Foundation. All rights reserved.