org.apache.hadoop.yarn.api
Interface ContainerManagementProtocol


@InterfaceAudience.Public
@InterfaceStability.Stable
public interface ContainerManagementProtocol

The protocol between an ApplicationMaster and a NodeManager to start/stop containers and to get status of running containers.

If security is enabled the NodeManager verifies that the ApplicationMaster has truly been allocated the container by the ResourceManager and also verifies all interactions such as stopping the container or obtaining status information for the container.


Method Summary
 GetContainerStatusesResponse getContainerStatuses(GetContainerStatusesRequest request)
           The API used by the ApplicationMaster to request for current statuses of Containers from the NodeManager.
 StartContainersResponse startContainers(StartContainersRequest request)
           The ApplicationMaster provides a list of StartContainerRequests to a NodeManager to start Containers allocated to it using this interface.
 StopContainersResponse stopContainers(StopContainersRequest request)
           The ApplicationMaster requests a NodeManager to stop a list of Containers allocated to it using this interface.
 

Method Detail

startContainers

@InterfaceAudience.Public
@InterfaceStability.Stable
StartContainersResponse startContainers(StartContainersRequest request)
                                        throws YarnException,
                                               IOException

The ApplicationMaster provides a list of StartContainerRequests to a NodeManager to start Containers 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 ContainerLaunchContext in the StartContainerRequest.

The NodeManager sends a response via StartContainersResponse which includes a list of Containers of successfully launched Containers, a containerId-to-exception map for each failed StartContainerRequest in which 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 getContainerStatuses(GetContainerStatusesRequest) to get updated statuses of the to-be-launched or launched containers.

Parameters:
request - request to start a list of containers
Returns:
response including conatinerIds of all successfully launched containers, a containerId-to-exception map for failed requests and a allServicesMetaData map.
Throws:
YarnException
IOException
org.apache.hadoop.yarn.exceptions.NMNotYetReadyException - This exception is thrown when NM starts from scratch but has not yet connected with RM.

stopContainers

@InterfaceAudience.Public
@InterfaceStability.Stable
StopContainersResponse stopContainers(StopContainersRequest request)
                                      throws YarnException,
                                             IOException

The ApplicationMaster requests a NodeManager to stop a list of Containers allocated to it using this interface.

The ApplicationMaster sends a StopContainersRequest which includes the ContainerIds of the containers to be stopped.

The NodeManager sends a response via StopContainersResponse which includes a list of ContainerId s of successfully stopped containers, a containerId-to-exception map for each failed request in which the exception indicates errors from per container. Note: None-container-specific exceptions will still be thrown by the API method itself. ApplicationMaster can use getContainerStatuses(GetContainerStatusesRequest) to get updated statuses of the containers.

Parameters:
request - request to stop a list of containers
Returns:
response which includes a list of containerIds of successfully stopped containers, a containerId-to-exception map for failed requests.
Throws:
YarnException
IOException

getContainerStatuses

@InterfaceAudience.Public
@InterfaceStability.Stable
GetContainerStatusesResponse getContainerStatuses(GetContainerStatusesRequest request)
                                                  throws YarnException,
                                                         IOException

The API used by the ApplicationMaster to request for current statuses of Containers from the NodeManager.

The ApplicationMaster sends a GetContainerStatusesRequest which includes the ContainerIds of all containers whose statuses are needed.

The NodeManager responds with GetContainerStatusesResponse which includes a list of ContainerStatus of the successfully queried containers and a containerId-to-exception map for each failed request in which the exception indicates errors from per container. Note: None-container-specific exceptions will still be thrown by the API method itself.

Parameters:
request - request to get ContainerStatuses of containers with the specified ContainerIds
Returns:
response containing the list of ContainerStatus of the successfully queried containers and a containerId-to-exception map for failed requests.
Throws:
YarnException
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.