Spring for Apache Hadoop

org.springframework.yarn.am
Class AppmasterCmTemplate

java.lang.Object
  extended by org.springframework.yarn.rpc.YarnRpcAccessor<org.apache.hadoop.yarn.api.ContainerManagementProtocol>
      extended by org.springframework.yarn.am.AppmasterCmTemplate
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, AppmasterCmOperations

public class AppmasterCmTemplate
extends YarnRpcAccessor<org.apache.hadoop.yarn.api.ContainerManagementProtocol>
implements AppmasterCmOperations

Template implementation for AppmasterCmOperations wrapping communication using ContainerManagementProtocol. Methods for this template wraps possible exceptions into Spring Dao exception hierarchy.

Author:
Janne Valkealahti

Constructor Summary
AppmasterCmTemplate(org.apache.hadoop.conf.Configuration config, org.apache.hadoop.yarn.api.records.Container container)
          Instantiates a new AppmasterCmTemplate.
 
Method Summary
 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.
 
Methods inherited from class org.springframework.yarn.rpc.YarnRpcAccessor
afterPropertiesSet, createProxy, destroy, execute, getConfiguration, getProxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppmasterCmTemplate

public AppmasterCmTemplate(org.apache.hadoop.conf.Configuration config,
                           org.apache.hadoop.yarn.api.records.Container container)
Instantiates a new AppmasterCmTemplate.

Parameters:
config - the hadoop configation
container - the Container
Method Detail

startContainers

public org.apache.hadoop.yarn.api.protocolrecords.StartContainersResponse startContainers(org.apache.hadoop.yarn.api.protocolrecords.StartContainersRequest request)
Description copied from interface: AppmasterCmOperations
Start container.

Specified by:
startContainers in interface AppmasterCmOperations
Parameters:
request - the request
Returns:
the start container response

stopContainers

public org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse stopContainers()
Description copied from interface: AppmasterCmOperations
Stop container.

Specified by:
stopContainers in interface AppmasterCmOperations
Returns:
the stop container response

getContainerStatus

public org.apache.hadoop.yarn.api.records.ContainerStatus getContainerStatus()
Description copied from interface: AppmasterCmOperations
Gets the container status.

Specified by:
getContainerStatus in interface AppmasterCmOperations
Returns:
the container status

getRpcAddress

protected java.net.InetSocketAddress getRpcAddress(org.apache.hadoop.conf.Configuration config)
Description copied from class: YarnRpcAccessor
Gets the InetSocketAddress where this accessor should connect.

Specified by:
getRpcAddress in class YarnRpcAccessor<org.apache.hadoop.yarn.api.ContainerManagementProtocol>
Parameters:
config - the yarn configuration
Returns:
address of rpc endpoint

getUser

protected org.apache.hadoop.security.UserGroupInformation getUser()
Description copied from class: YarnRpcAccessor
Gets the user used to create the proxy. Default implementation delegates into UserGroupInformation.getCurrentUser().

Overrides:
getUser in class YarnRpcAccessor<org.apache.hadoop.yarn.api.ContainerManagementProtocol>
Returns:
the user
See Also:
YarnRpcAccessor.createProxy()

Spring for Apache Hadoop