@InterfaceAudience.Private public class ContainerManagementProtocolPBClientImpl extends Object implements ContainerManagementProtocol, Closeable
Constructor and Description |
---|
ContainerManagementProtocolPBClientImpl(long clientVersion,
InetSocketAddress addr,
Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
GetContainerStatusesResponse |
getContainerStatuses(GetContainerStatusesRequest request)
The API used by the
ApplicationMaster to request for current
statuses of Container s from the NodeManager . |
StartContainersResponse |
startContainers(StartContainersRequest requests)
The
ApplicationMaster provides a list of
StartContainerRequest s to a NodeManager to
start Container s allocated to it using this interface. |
StopContainersResponse |
stopContainers(StopContainersRequest requests)
The
ApplicationMaster requests a NodeManager to
stop a list of Container s allocated to it using this
interface. |
public ContainerManagementProtocolPBClientImpl(long clientVersion, InetSocketAddress addr, Configuration conf) throws IOException
IOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public StartContainersResponse startContainers(StartContainersRequest requests) throws YarnException, IOException
ContainerManagementProtocol
The ApplicationMaster
provides a list of
StartContainerRequest
s to a NodeManager
to
start 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 ContainerLaunchContext
in
the StartContainerRequest
.
The NodeManager
sends a response via
StartContainersResponse
which includes a list of
Container
s of successfully launched Container
s, 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
ContainerManagementProtocol.getContainerStatuses(GetContainerStatusesRequest)
to get updated
statuses of the to-be-launched or launched containers.
startContainers
in interface ContainerManagementProtocol
requests
- request to start a list of containersYarnException
NMNotYetReadyException
- This exception is thrown when NM starts from scratch but has not
yet connected with RM.IOException
public StopContainersResponse stopContainers(StopContainersRequest requests) throws YarnException, IOException
ContainerManagementProtocol
The ApplicationMaster
requests a NodeManager
to
stop a list of Container
s allocated to it using this
interface.
The ApplicationMaster
sends a StopContainersRequest
which includes the ContainerId
s 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
ContainerManagementProtocol.getContainerStatuses(GetContainerStatusesRequest)
to get updated
statuses of the containers.
stopContainers
in interface ContainerManagementProtocol
requests
- request to stop a list of containersYarnException
IOException
public GetContainerStatusesResponse getContainerStatuses(GetContainerStatusesRequest request) throws YarnException, IOException
ContainerManagementProtocol
The API used by the ApplicationMaster
to request for current
statuses of Container
s from the NodeManager
.
The ApplicationMaster
sends a
GetContainerStatusesRequest
which includes the ContainerId
s
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.
getContainerStatuses
in interface ContainerManagementProtocol
request
- request to get ContainerStatus
es of containers with
the specified ContainerId
sContainerStatus
of the
successfully queried containers and a containerId-to-exception map
for failed requests.YarnException
IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.