Class RMCommunicator

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator
All Implemented Interfaces:
Closeable, AutoCloseable, 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.
  • Field Details

    • 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
    • applicationACLs

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

      protected volatile boolean isSignalled
  • Constructor Details

  • Method Details

    • 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

      @VisibleForTesting 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

      @VisibleForTesting protected boolean isApplicationMasterRegistered()
    • getSchedulerResourceTypes

      public EnumSet<org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes> getSchedulerResourceTypes()