Class AMHeartbeatRequestHandler

java.lang.Object
java.lang.Thread
org.apache.hadoop.util.concurrent.SubjectInheritingThread
org.apache.hadoop.yarn.server.AMHeartbeatRequestHandler
All Implemented Interfaces:
Runnable

public class AMHeartbeatRequestHandler extends org.apache.hadoop.util.concurrent.SubjectInheritingThread
Extends Thread and provides an implementation that is used for processing the AM heart beat request asynchronously and sending back the response using the callback method registered with the system.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

    • AMHeartbeatRequestHandler

      public AMHeartbeatRequestHandler(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.api.records.ApplicationId applicationId, AMRMClientRelayer rmProxyRelayer)
  • Method Details

    • shutdown

      public void shutdown()
      Shutdown the thread.
    • work

      public void work()
      Overrides:
      work in class org.apache.hadoop.util.concurrent.SubjectInheritingThread
    • resetLastResponseId

      public void resetLastResponseId()
      Reset the lastResponseId to zero.
    • setUGI

      public void setUGI(org.apache.hadoop.security.UserGroupInformation ugi)
      Set the UGI for RM connection.
      Parameters:
      ugi - UserGroupInformation.
    • allocateAsync

      public void allocateAsync(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request, org.apache.hadoop.yarn.util.AsyncCallback<org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse> callback) throws org.apache.hadoop.yarn.exceptions.YarnException
      Sends the specified heart beat request to the resource manager and invokes the callback asynchronously with the response.
      Parameters:
      request - the allocate request
      callback - the callback method for the request
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if registerAM is not called yet
    • drainHeartbeatThread

      @VisibleForTesting public void drainHeartbeatThread()
    • getRequestQueueSize

      @VisibleForTesting public int getRequestQueueSize()