public class AppmasterRmTemplate extends YarnRpcAccessor<org.apache.hadoop.yarn.api.ApplicationMasterProtocol> implements AppmasterRmOperations
AppmasterRmOperations
wrapping
communication using ApplicationMasterProtocol
. Methods for this
template wraps possible exceptions into Spring Dao exception hierarchy.Constructor and Description |
---|
AppmasterRmTemplate(org.apache.hadoop.conf.Configuration config)
Instantiates a new AppmasterRmTemplate.
|
Modifier and Type | Method and Description |
---|---|
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.
|
afterPropertiesSet, createProxy, destroy, execute, getConfiguration, getProxy, getUser
public AppmasterRmTemplate(org.apache.hadoop.conf.Configuration config)
config
- the hadoop configurationpublic org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(java.lang.String host, java.lang.Integer rpcPort, java.lang.String trackUrl)
AppmasterRmOperations
registerApplicationMaster
in interface AppmasterRmOperations
host
- the hostrpcPort
- the rpc porttrackUrl
- the track urlRegisterApplicationMasterResponse
public org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request)
AppmasterRmOperations
allocate
in interface AppmasterRmOperations
request
- the requestpublic org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse finish(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request)
AppmasterRmOperations
finish
in interface AppmasterRmOperations
request
- the FinishApplicationMasterRequest
FinishApplicationMasterResponse
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.ApplicationMasterProtocol>
config
- the yarn configuration