Class ApplicationMasterService

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.server.resourcemanager.ApplicationMasterService
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.service.Service, org.apache.hadoop.yarn.api.ApplicationMasterProtocol
Direct Known Subclasses:
OpportunisticContainerAllocatorAMService

@Private public class ApplicationMasterService extends org.apache.hadoop.service.AbstractService implements org.apache.hadoop.yarn.api.ApplicationMasterProtocol
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service

    org.apache.hadoop.service.Service.STATE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final Allocation
     
     
    protected final org.apache.hadoop.yarn.factories.RecordFactory
     
    protected final RMContext
     
    protected org.apache.hadoop.ipc.Server
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse
    allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request)
     
    org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse
    finishApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request)
     
     
    protected org.apache.hadoop.yarn.server.resourcemanager.AMSProcessingChain
     
    protected List<org.apache.hadoop.yarn.ams.ApplicationMasterServiceProcessor>
    getProcessorList(org.apache.hadoop.conf.Configuration conf)
     
    org.apache.hadoop.ipc.Server
     
    protected org.apache.hadoop.ipc.Server
    getServer(org.apache.hadoop.yarn.ipc.YarnRPC rpc, org.apache.hadoop.conf.Configuration serverConf, InetSocketAddress addr, AMRMTokenSecretManager secretManager)
     
    boolean
    hasApplicationMasterRegistered(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
     
    void
    refreshServiceAcls(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.security.authorize.PolicyProvider policyProvider)
     
    void
    registerAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId)
     
    org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse
    registerApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request)
     
    protected void
    serviceInit(org.apache.hadoop.conf.Configuration conf)
     
    protected void
     
    protected void
     
    protected boolean
    setAttemptLastResponseId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, int lastResponseId)
     
    void
    unregisterAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId)
     

    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 Details

    • masterServiceAddress

      protected InetSocketAddress masterServiceAddress
    • server

      protected org.apache.hadoop.ipc.Server server
    • recordFactory

      protected final org.apache.hadoop.yarn.factories.RecordFactory recordFactory
    • rmContext

      protected final RMContext rmContext
    • EMPTY_ALLOCATION

      protected static final Allocation EMPTY_ALLOCATION
  • 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
    • getProcessorList

      protected List<org.apache.hadoop.yarn.ams.ApplicationMasterServiceProcessor> getProcessorList(org.apache.hadoop.conf.Configuration conf)
    • serviceStart

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

      protected org.apache.hadoop.ipc.Server getServer(org.apache.hadoop.yarn.ipc.YarnRPC rpc, org.apache.hadoop.conf.Configuration serverConf, InetSocketAddress addr, AMRMTokenSecretManager secretManager)
    • getProcessingChain

      protected org.apache.hadoop.yarn.server.resourcemanager.AMSProcessingChain getProcessingChain()
    • getBindAddress

      @Private public InetSocketAddress getBindAddress()
    • registerApplicationMaster

      public org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      Specified by:
      registerApplicationMaster in interface org.apache.hadoop.yarn.api.ApplicationMasterProtocol
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
      IOException
    • finishApplicationMaster

      public org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse finishApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      Specified by:
      finishApplicationMaster in interface org.apache.hadoop.yarn.api.ApplicationMasterProtocol
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
      IOException
    • hasApplicationMasterRegistered

      public boolean hasApplicationMasterRegistered(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
      Parameters:
      appAttemptId -
      Returns:
      true if application is registered for the respective attemptid
    • allocate

      public org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      Specified by:
      allocate in interface org.apache.hadoop.yarn.api.ApplicationMasterProtocol
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
      IOException
    • registerAppAttempt

      public void registerAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId)
    • setAttemptLastResponseId

      @VisibleForTesting protected boolean setAttemptLastResponseId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, int lastResponseId)
    • unregisterAttempt

      public void unregisterAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId)
    • refreshServiceAcls

      public void refreshServiceAcls(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.security.authorize.PolicyProvider policyProvider)
    • serviceStop

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

      @VisibleForTesting public org.apache.hadoop.ipc.Server getServer()