org.apache.hadoop.mapreduce.v2.app.rm
Class RMCommunicator

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator
All Implemented Interfaces:
Closeable, RMHeartbeatHandler, org.apache.hadoop.service.Service
Direct Known Subclasses:
LocalContainerAllocator, RMContainerRequestor

public abstract class RMCommunicator
extends org.apache.hadoop.service.AbstractService
implements RMHeartbeatHandler

Registers/unregisters to RM and sends heartbeats to RM.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Field Summary
protected  Thread allocatorThread
           
protected  Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,String> applicationACLs
           
protected  org.apache.hadoop.yarn.api.records.ApplicationId applicationId
           
protected  org.apache.hadoop.yarn.event.EventHandler eventHandler
           
protected  boolean isSignalled
           
protected  int lastResponseID
           
protected  org.apache.hadoop.yarn.api.ApplicationMasterProtocol scheduler
           
 
Constructor Summary
RMCommunicator(ClientService clientService, AppContext context)
           
 
Method Summary
protected  org.apache.hadoop.yarn.api.ApplicationMasterProtocol createSchedulerProxy()
           
protected  void doUnregistration()
           
protected  float getApplicationProgress()
          Get the appProgress.
protected  AppContext getContext()
           
protected  Job getJob()
           
 long getLastHeartbeatTime()
           
protected  org.apache.hadoop.yarn.api.records.Resource getMaxContainerCapability()
           
protected abstract  void heartbeat()
           
protected  boolean isApplicationMasterRegistered()
           
protected  void register()
           
 void runOnNextHeartbeat(Runnable callback)
           
protected  void serviceInit(org.apache.hadoop.conf.Configuration conf)
           
protected  void serviceStart()
           
protected  void serviceStop()
           
 void setShouldUnregister(boolean shouldUnregister)
           
 void setSignalled(boolean isSignalled)
           
protected  void startAllocatorThread()
           
protected  void unregister()
           
 
Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

applicationId

protected org.apache.hadoop.yarn.api.records.ApplicationId applicationId

allocatorThread

protected Thread allocatorThread

eventHandler

protected org.apache.hadoop.yarn.event.EventHandler eventHandler

scheduler

protected org.apache.hadoop.yarn.api.ApplicationMasterProtocol scheduler

lastResponseID

protected int lastResponseID

applicationACLs

protected Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,String> applicationACLs

isSignalled

protected volatile boolean isSignalled
Constructor Detail

RMCommunicator

public RMCommunicator(ClientService clientService,
                      AppContext context)
Method Detail

serviceInit

protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
                    throws Exception
Overrides:
serviceInit in class org.apache.hadoop.service.AbstractService
Throws:
Exception

serviceStart

protected void serviceStart()
                     throws Exception
Overrides:
serviceStart in class org.apache.hadoop.service.AbstractService
Throws:
Exception

getContext

protected AppContext getContext()

getJob

protected Job getJob()

getApplicationProgress

protected float getApplicationProgress()
Get the appProgress. Can be used only after this component is started.

Returns:
the appProgress.

register

protected void register()

unregister

protected void unregister()

doUnregistration

protected void doUnregistration()
                         throws org.apache.hadoop.yarn.exceptions.YarnException,
                                IOException,
                                InterruptedException
Throws:
org.apache.hadoop.yarn.exceptions.YarnException
IOException
InterruptedException

getMaxContainerCapability

protected org.apache.hadoop.yarn.api.records.Resource getMaxContainerCapability()

serviceStop

protected void serviceStop()
                    throws Exception
Overrides:
serviceStop in class org.apache.hadoop.service.AbstractService
Throws:
Exception

startAllocatorThread

protected void startAllocatorThread()

createSchedulerProxy

protected org.apache.hadoop.yarn.api.ApplicationMasterProtocol createSchedulerProxy()

heartbeat

protected abstract void heartbeat()
                           throws Exception
Throws:
Exception

getLastHeartbeatTime

public long getLastHeartbeatTime()
Specified by:
getLastHeartbeatTime in interface RMHeartbeatHandler

runOnNextHeartbeat

public void runOnNextHeartbeat(Runnable callback)
Specified by:
runOnNextHeartbeat in interface RMHeartbeatHandler

setShouldUnregister

public void setShouldUnregister(boolean shouldUnregister)

setSignalled

public void setSignalled(boolean isSignalled)

isApplicationMasterRegistered

protected boolean isApplicationMasterRegistered()


Copyright © 2014 Apache Software Foundation. All Rights Reserved.