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.AMRMProtocol>
      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.AMRMProtocol>
implements AppmasterRmOperations

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

Author:
Janne Valkealahti

Constructor Summary
AppmasterRmTemplate(org.apache.hadoop.conf.Configuration config)
           
 
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(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, 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)
Method Detail

registerApplicationMaster

public org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
                                                                                                              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:
appAttemptId - the app attempt id
host - the host
rpcPort - the rpc port
trackUrl - the track url
Returns:
the register application master response

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 request
Returns:
the finish application master response

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

Spring for Apache Hadoop