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.ContainerManager>
      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.ContainerManager>
implements AppmasterCmOperations

Template implementation for AppmasterCmOperations wrapping communication using ContainerManager. 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)
           
 
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.StartContainerResponse startContainer(org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest request)
          Start container.
 org.apache.hadoop.yarn.api.protocolrecords.StopContainerResponse stopContainer()
          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)
Method Detail

startContainer

public org.apache.hadoop.yarn.api.protocolrecords.StartContainerResponse startContainer(org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest request)
Description copied from interface: AppmasterCmOperations
Start container.

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

stopContainer

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

Specified by:
stopContainer 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.ContainerManager>
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 returns null which means no security is used.

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

Spring for Apache Hadoop