@InterfaceAudience.Private public class ApplicationMasterProtocolPBClientImpl extends Object implements ApplicationMasterProtocol, Closeable
Constructor and Description |
---|
ApplicationMasterProtocolPBClientImpl(long clientVersion,
InetSocketAddress addr,
Configuration conf) |
Modifier and Type | Method and Description |
---|---|
AllocateResponse |
allocate(AllocateRequest request)
The main interface between an
ApplicationMaster and the
ResourceManager . |
void |
close() |
FinishApplicationMasterResponse |
finishApplicationMaster(FinishApplicationMasterRequest request)
The interface used by an
ApplicationMaster to notify the
ResourceManager about its completion (success or failed). |
RegisterApplicationMasterResponse |
registerApplicationMaster(RegisterApplicationMasterRequest request)
The interface used by a new
ApplicationMaster to register with
the ResourceManager . |
public ApplicationMasterProtocolPBClientImpl(long clientVersion, InetSocketAddress addr, Configuration conf) throws IOException
IOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public AllocateResponse allocate(AllocateRequest request) throws YarnException, IOException
ApplicationMasterProtocol
The main interface between an ApplicationMaster
and the
ResourceManager
.
The ApplicationMaster
uses this interface to provide a list of
ResourceRequest
and returns unused Container
allocated to
it via AllocateRequest
. Optionally, the
ApplicationMaster
can also blacklist resources which
it doesn't want to use.
This also doubles up as a heartbeat to let the
ResourceManager
know that the ApplicationMaster
is alive. Thus, applications should periodically make this call to be kept
alive. The frequency depends on
YarnConfiguration.RM_AM_EXPIRY_INTERVAL_MS
which defaults to
YarnConfiguration.DEFAULT_RM_AM_EXPIRY_INTERVAL_MS
.
The ResourceManager
responds with list of allocated
Container
, status of completed containers and headroom information
for the application.
The ApplicationMaster
can use the available headroom
(resources) to decide how to utilized allocated resources and make informed
decisions about future resource requests.
allocate
in interface ApplicationMasterProtocol
request
- allocation requestYarnException
InvalidApplicationMasterRequestException
- This exception is thrown when an ApplicationMaster calls allocate
without registering first.InvalidResourceBlacklistRequestException
- This exception is thrown when an application provides an invalid
specification for blacklist of resources.InvalidResourceRequestException
- This exception is thrown when a ResourceRequest
is out of
the range of the configured lower and upper limits on the
resources.IOException
AllocateRequest
,
AllocateResponse
public FinishApplicationMasterResponse finishApplicationMaster(FinishApplicationMasterRequest request) throws YarnException, IOException
ApplicationMasterProtocol
The interface used by an ApplicationMaster
to notify the
ResourceManager
about its completion (success or failed).
The ApplicationMaster
has to provide details such as
final state, diagnostics (in case of failures) etc. as specified in
FinishApplicationMasterRequest
.
The ResourceManager
responds with
FinishApplicationMasterResponse
.
finishApplicationMaster
in interface ApplicationMasterProtocol
request
- completion requestYarnException
IOException
FinishApplicationMasterRequest
,
FinishApplicationMasterResponse
public RegisterApplicationMasterResponse registerApplicationMaster(RegisterApplicationMasterRequest request) throws YarnException, IOException
ApplicationMasterProtocol
The interface used by a new ApplicationMaster
to register with
the ResourceManager
.
The ApplicationMaster
needs to provide details such as RPC
Port, HTTP tracking url etc. as specified in
RegisterApplicationMasterRequest
.
The ResourceManager
responds with critical details such as
maximum resource capabilities in the cluster as specified in
RegisterApplicationMasterResponse
.
registerApplicationMaster
in interface ApplicationMasterProtocol
request
- registration requestYarnException
InvalidApplicationMasterRequestException
- The exception is thrown when an ApplicationMaster tries to
register more then once.IOException
RegisterApplicationMasterRequest
,
RegisterApplicationMasterResponse
Copyright © 2013 Apache Software Foundation. All rights reserved.