The main interface between an ApplicationMaster and the ResourceManager.
The ApplicationMaster uses this interface to provide a list of {@link ResourceRequest} and returns unused {@link Container} allocated toit via {@link 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 {@link YarnConfiguration#RM_AM_EXPIRY_INTERVAL_MS} which defaults to{@link YarnConfiguration#DEFAULT_RM_AM_EXPIRY_INTERVAL_MS}.
The ResourceManager responds with list of allocated {@link 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.
@param request allocation request
@return allocation response
@throws YarnException
@throws IOException
@throws InvalidApplicationMasterRequestException This exception is thrown when an ApplicationMaster calls allocate without registering first.
@throws InvalidResourceBlacklistRequestException This exception is thrown when an application provides an invalid specification for blacklist of resources.
@throws InvalidResourceRequestException This exception is thrown when a {@link ResourceRequest} is out ofthe range of the configured lower and upper limits on the resources.
@see AllocateRequest
@see AllocateResponse