Spring for Apache Hadoop

org.springframework.yarn.am
Class AppmasterRmTemplate

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

public class AppmasterRmTemplate
extends YarnRpcAccessor<org.apache.hadoop.yarn.api.ApplicationMasterProtocol>
implements AppmasterRmOperations

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

Author:
Janne Valkealahti

Constructor Summary
AppmasterRmTemplate(org.apache.hadoop.conf.Configuration config)
          Instantiates a new AppmasterRmTemplate.
 
Method Summary
 org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request)
          Allocate container.
 org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse finish(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request)
          Finish the application master.
protected  java.net.InetSocketAddress getRpcAddress(org.apache.hadoop.conf.Configuration config)
          Gets the InetSocketAddress where this accessor should connect.
 org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(java.lang.String host, java.lang.Integer rpcPort, java.lang.String trackUrl)
          Register application master.
 
Methods inherited from class org.springframework.yarn.rpc.YarnRpcAccessor
afterPropertiesSet, createProxy, destroy, execute, getConfiguration, getProxy, getUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppmasterRmTemplate

public AppmasterRmTemplate(org.apache.hadoop.conf.Configuration config)
Instantiates a new AppmasterRmTemplate.

Parameters:
config - the hadoop configuration
Method Detail

registerApplicationMaster

public org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(java.lang.String host,
                                                                                                              java.lang.Integer rpcPort,
                                                                                                              java.lang.String trackUrl)
Description copied from interface: AppmasterRmOperations
Register application master.

Specified by:
registerApplicationMaster in interface AppmasterRmOperations
Parameters:
host - the host
rpcPort - the rpc port
trackUrl - the track url
Returns:
the RegisterApplicationMasterResponse

allocate

public org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request)
Description copied from interface: AppmasterRmOperations
Allocate container.

Specified by:
allocate in interface AppmasterRmOperations
Parameters:
request - the request
Returns:
the allocate response

finish

public org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse finish(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request)
Description copied from interface: AppmasterRmOperations
Finish the application master.

Specified by:
finish in interface AppmasterRmOperations
Parameters:
request - the FinishApplicationMasterRequest
Returns:
the FinishApplicationMasterResponse

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.ApplicationMasterProtocol>
Parameters:
config - the yarn configuration
Returns:
address of rpc endpoint

Spring for Apache Hadoop