org.apache.hadoop.yarn.api
Interface ContainerManager


@InterfaceAudience.Public
@InterfaceStability.Stable
public interface ContainerManager

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
 GetContainerStatusResponse getContainerStatus(GetContainerStatusRequest request)
          The api used by the ApplicationMaster to request for current status of a Container from the NodeManager.
 StartContainerResponse startContainer(StartContainerRequest request)
          The ApplicationMaster requests a NodeManager to start a Container allocated to it using this interface.
 StopContainerResponse stopContainer(StopContainerRequest request)
          The ApplicationMaster requests a NodeManager to stop a Container allocated to it using this interface.
 

Method Detail

startContainer

@InterfaceAudience.Public
@InterfaceStability.Stable
StartContainerResponse startContainer(StartContainerRequest request)
                                      throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

The ApplicationMaster requests a NodeManager to start a Container 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.

Currently the NodeManager sends an immediate, empty response via StartContainerResponse to signify acceptance of the request and throws an exception in case of errors. The ApplicationMaster can use getContainerStatus(GetContainerStatusRequest) to get updated status of the to-be-launched or launched container.

Parameters:
request - request to start a container
Returns:
empty response to indicate acceptance of the request or an exception
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

stopContainer

@InterfaceAudience.Public
@InterfaceStability.Stable
StopContainerResponse stopContainer(StopContainerRequest request)
                                    throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

The ApplicationMaster requests a NodeManager to stop a Container allocated to it using this interface.

The ApplicationMaster sends a StopContainerRequest which includes the ContainerId of the container to be stopped.

Currently the NodeManager sends an immediate, empty response via StopContainerResponse to signify acceptance of the request and throws an exception in case of errors. The ApplicationMaster can use getContainerStatus(GetContainerStatusRequest) to get updated status of the container.

Parameters:
request - request to stop a container
Returns:
empty response to indicate acceptance of the request or an exception
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

getContainerStatus

@InterfaceAudience.Public
@InterfaceStability.Stable
GetContainerStatusResponse getContainerStatus(GetContainerStatusRequest request)
                                              throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

The api used by the ApplicationMaster to request for current status of a Container from the NodeManager.

The ApplicationMaster sends a GetContainerStatusRequest which includes the ContainerId of the container whose status is needed.

The NodeManager responds with GetContainerStatusResponse which includes the ContainerStatus of the container.

Parameters:
request - request to get ContainerStatus of a container with the specified ContainerId
Returns:
response containing the ContainerStatus of the container
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.