Interface ApplicationMasterProtocol
The protocol between a live instance of ApplicationMaster
and the ResourceManager.
This is used by the ApplicationMaster to register/unregister
and to request and obtain resources in the cluster from the
ResourceManager.
-
Method Summary
Modifier and TypeMethodDescriptionallocate(AllocateRequest request) The main interface between anApplicationMasterand theResourceManager.The interface used by anApplicationMasterto notify theResourceManagerabout its completion (success or failed).The interface used by a newApplicationMasterto register with theResourceManager.
-
Method Details
-
registerApplicationMaster
@Public @Stable RegisterApplicationMasterResponse registerApplicationMaster(RegisterApplicationMasterRequest request) throws YarnException, IOException The interface used by a new
ApplicationMasterto register with theResourceManager.The
ApplicationMasterneeds to provide details such as RPC Port, HTTP tracking url etc. as specified inRegisterApplicationMasterRequest.The
ResourceManagerresponds with critical details such as maximum resource capabilities in the cluster as specified inRegisterApplicationMasterResponse.Re-register is only allowed for
Unmanaged Application Master(UAM) HA, withApplicationSubmissionContext.getKeepContainersAcrossApplicationAttempts()set to true.- Parameters:
request- registration request- Returns:
- registration response
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.InvalidApplicationMasterRequestException- The exception is thrown when an ApplicationMaster tries to register more then once.- See Also:
-
finishApplicationMaster
@Public @Stable FinishApplicationMasterResponse finishApplicationMaster(FinishApplicationMasterRequest request) throws YarnException, IOException The interface used by an
ApplicationMasterto notify theResourceManagerabout its completion (success or failed).The
ApplicationMasterhas to provide details such as final state, diagnostics (in case of failures) etc. as specified inFinishApplicationMasterRequest.The
ResourceManagerresponds withFinishApplicationMasterResponse.- Parameters:
request- completion request- Returns:
- completion response
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.- See Also:
-
allocate
@Public @Stable AllocateResponse allocate(AllocateRequest request) throws YarnException, IOException The main interface between an
ApplicationMasterand theResourceManager.The
ApplicationMasteruses this interface to provide a list ofResourceRequestand returns unusedContainerallocated to it viaAllocateRequest. Optionally, theApplicationMastercan also blacklist resources which it doesn't want to use.This also doubles up as a heartbeat to let the
ResourceManagerknow that theApplicationMasteris alive. Thus, applications should periodically make this call to be kept alive. The frequency depends onYarnConfiguration.RM_AM_EXPIRY_INTERVAL_MSwhich defaults toYarnConfiguration.DEFAULT_RM_AM_EXPIRY_INTERVAL_MS.The
ResourceManagerresponds with list of allocatedContainer, status of completed containers and headroom information for the application.The
ApplicationMastercan use the available headroom (resources) to decide how to utilized allocated resources and make informed decisions about future resource requests.- Parameters:
request- allocation request- Returns:
- allocation response
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.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 aResourceRequestis out of the range of the configured lower and upper limits on the resources.- See Also:
-