public class AppmasterCmTemplate extends YarnRpcAccessor<org.apache.hadoop.yarn.api.ContainerManagementProtocol> implements AppmasterCmOperations
AppmasterCmOperations
wrapping
communication using ContainerManagementProtocol
. Methods for this
template wraps possible exceptions into Spring Dao exception hierarchy.Constructor and Description |
---|
AppmasterCmTemplate(org.apache.hadoop.conf.Configuration config,
org.apache.hadoop.yarn.api.records.Container container)
Instantiates a new AppmasterCmTemplate.
|
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.yarn.api.records.ContainerStatus |
getContainerStatus()
Gets the container status.
|
protected java.net.InetSocketAddress |
getRpcAddress(org.apache.hadoop.conf.Configuration config)
Gets the
InetSocketAddress where this accessor should connect. |
protected org.apache.hadoop.security.UserGroupInformation |
getUser()
Gets the
user used to
create the proxy. |
org.apache.hadoop.yarn.api.protocolrecords.StartContainersResponse |
startContainers(org.apache.hadoop.yarn.api.protocolrecords.StartContainersRequest request)
Start container.
|
org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse |
stopContainers()
Stop container.
|
afterPropertiesSet, createProxy, destroy, execute, getConfiguration, getProxy
public AppmasterCmTemplate(org.apache.hadoop.conf.Configuration config, org.apache.hadoop.yarn.api.records.Container container)
config
- the hadoop configationcontainer
- the Container
public org.apache.hadoop.yarn.api.protocolrecords.StartContainersResponse startContainers(org.apache.hadoop.yarn.api.protocolrecords.StartContainersRequest request)
AppmasterCmOperations
startContainers
in interface AppmasterCmOperations
request
- the requestpublic org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse stopContainers()
AppmasterCmOperations
stopContainers
in interface AppmasterCmOperations
public org.apache.hadoop.yarn.api.records.ContainerStatus getContainerStatus()
AppmasterCmOperations
getContainerStatus
in interface AppmasterCmOperations
protected java.net.InetSocketAddress getRpcAddress(org.apache.hadoop.conf.Configuration config)
YarnRpcAccessor
InetSocketAddress
where this accessor should connect.getRpcAddress
in class YarnRpcAccessor<org.apache.hadoop.yarn.api.ContainerManagementProtocol>
config
- the yarn configurationprotected org.apache.hadoop.security.UserGroupInformation getUser()
YarnRpcAccessor
user
used to
create the proxy. Default implementation delegates into
UserGroupInformation.getCurrentUser()
.getUser
in class YarnRpcAccessor<org.apache.hadoop.yarn.api.ContainerManagementProtocol>
YarnRpcAccessor.createProxy()