The ApplicationMaster
provides a list of {@link StartContainerRequest}s to a NodeManager
to start {@link Container}s allocated to it using this interface.
The ApplicationMaster
has to provide details such as allocated resource capability, security tokens (if enabled), command to be executed to start the container, environment for the process, necessary binaries/jar/shared-objects etc. via the {@link ContainerLaunchContext} inthe {@link StartContainerRequest}.
The NodeManager
sends a response via {@link StartContainersResponse} which includes a list of{@link Container}s of successfully launched {@link Container}s, a containerId-to-exception map for each failed {@link StartContainerRequest} inwhich the exception indicates errors from per container and a allServicesMetaData map between the names of auxiliary services and their corresponding meta-data. Note: None-container-specific exceptions will still be thrown by the API method itself.
The ApplicationMaster
can use {@link #getContainerStatuses(GetContainerStatusesRequest)} to get updatedstatuses of the to-be-launched or launched containers.
@param request request to start a list of containers
@return response including conatinerIds of all successfully launchedcontainers, a containerId-to-exception map for failed requests and a allServicesMetaData map.
@throws YarnException
@throws IOException
@throws NMNotYetReadyException This exception is thrown when NM starts from scratch but has not yet connected with RM.