org.apache.hadoop.yarn.server.resourcemanager
Class ResourceManager

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.service.CompositeService
          extended by org.apache.hadoop.yarn.server.resourcemanager.ResourceManager
All Implemented Interfaces:
Closeable, org.apache.hadoop.service.Service, Recoverable

public class ResourceManager
extends org.apache.hadoop.service.CompositeService
implements Recoverable

The ResourceManager is the main class that is a set of components. "I am the ResourceManager. All your resources belong to us..."


Nested Class Summary
static class ResourceManager.ApplicationAttemptEventDispatcher
           
static class ResourceManager.ApplicationEventDispatcher
           
static class ResourceManager.NodeEventDispatcher
           
 class ResourceManager.RMActiveServices
          RMActiveServices handles all the Active services in the RM.
static class ResourceManager.RMContainerPreemptEventDispatcher
           
static class ResourceManager.RMFatalEventDispatcher
           
static class ResourceManager.SchedulerEventDispatcher
           
 
Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService
org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHook
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Field Summary
protected  ResourceManager.RMActiveServices activeServices
          "Active" services.
protected  AdminService adminService
           
protected  org.apache.hadoop.yarn.server.security.ApplicationACLsManager applicationACLsManager
           
protected  ApplicationMasterService masterService
           
protected  NMLivelinessMonitor nmLivelinessMonitor
           
protected  NodesListManager nodesListManager
           
protected  QueueACLsManager queueACLsManager
           
protected  ReservationSystem reservationSystem
           
protected  ResourceTrackerService resourceTracker
           
protected  RMAppManager rmAppManager
           
protected  RMContextImpl rmContext
          "Always On" services.
protected  RMSecretManagerService rmSecretManagerService
           
protected  ResourceScheduler scheduler
           
static int SHUTDOWN_HOOK_PRIORITY
          Priority of the ResourceManager shutdown hook.
protected  String webAppAddress
           
 
Fields inherited from class org.apache.hadoop.service.CompositeService
STOP_ONLY_STARTED_SERVICES
 
Constructor Summary
ResourceManager()
           
 
Method Summary
protected  boolean areActiveServicesRunning()
           
protected  AdminService createAdminService()
           
protected  ApplicationMasterLauncher createAMLauncher()
           
protected  AMLivelinessMonitor createAMLivelinessMonitor()
           
protected  void createAndInitActiveServices()
          Helper method to create and init activeServices.
protected  ApplicationMasterService createApplicationMasterService()
           
protected  ClientRMService createClientRMService()
           
protected  DelegationTokenRenewer createDelegationTokenRenewer()
           
protected  org.apache.hadoop.yarn.event.Dispatcher createDispatcher()
           
protected  RMNodeLabelsManager createNodeLabelManager()
           
protected  QueueACLsManager createQueueACLsManager(ResourceScheduler scheduler, org.apache.hadoop.conf.Configuration conf)
           
protected  ReservationSystem createReservationSystem()
           
protected  ResourceTrackerService createResourceTrackerService()
           
protected  RMApplicationHistoryWriter createRMApplicationHistoryWriter()
           
protected  RMAppManager createRMAppManager()
           
protected  RMSecretManagerService createRMSecretManagerService()
           
protected  ResourceScheduler createScheduler()
           
protected  org.apache.hadoop.yarn.event.EventHandler<SchedulerEvent> createSchedulerEventDispatcher()
           
protected  SystemMetricsPublisher createSystemMetricsPublisher()
           
protected  void doSecureLogin()
           
 org.apache.hadoop.yarn.server.security.ApplicationACLsManager getApplicationACLsManager()
           
 ApplicationMasterService getApplicationMasterService()
           
static InetSocketAddress getBindAddress(org.apache.hadoop.conf.Configuration conf)
          Retrieve RM bind address from configuration
 ClientRMService getClientRMService()
           
static long getClusterTimeStamp()
           
 QueueACLsManager getQueueACLsManager()
           
 ResourceScheduler getResourceScheduler()
          return the scheduler.
 ResourceTrackerService getResourceTrackerService()
          return the resource tracking component.
 RMContext getRMContext()
           
 void handleTransitionToStandBy()
           
static void main(String[] argv)
           
 void recover(RMStateStore.RMState state)
           
protected  void serviceInit(org.apache.hadoop.conf.Configuration conf)
           
protected  void serviceStart()
           
protected  void serviceStop()
           
protected static void setClusterTimeStamp(long timestamp)
           
protected  void setRMStateStore(RMStateStore rmStore)
           
protected  void startWepApp()
           
protected static void validateConfigs(org.apache.hadoop.conf.Configuration conf)
           
 
Methods inherited from class org.apache.hadoop.service.CompositeService
addIfService, addService, getServices, removeService
 
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

SHUTDOWN_HOOK_PRIORITY

public static final int SHUTDOWN_HOOK_PRIORITY
Priority of the ResourceManager shutdown hook.

See Also:
Constant Field Values

rmContext

protected RMContextImpl rmContext
"Always On" services. Services that need to run always irrespective of the HA state of the RM.


adminService

protected AdminService adminService

activeServices

protected ResourceManager.RMActiveServices activeServices
"Active" services. Services that need to run only on the Active RM. These services are managed (initialized, started, stopped) by the CompositeService RMActiveServices. RM is active when (1) HA is disabled, or (2) HA is enabled and the RM is in Active state.


rmSecretManagerService

protected RMSecretManagerService rmSecretManagerService

scheduler

protected ResourceScheduler scheduler

reservationSystem

protected ReservationSystem reservationSystem

masterService

protected ApplicationMasterService masterService

nmLivelinessMonitor

protected NMLivelinessMonitor nmLivelinessMonitor

nodesListManager

protected NodesListManager nodesListManager

rmAppManager

protected RMAppManager rmAppManager

applicationACLsManager

protected org.apache.hadoop.yarn.server.security.ApplicationACLsManager applicationACLsManager

queueACLsManager

protected QueueACLsManager queueACLsManager

resourceTracker

protected ResourceTrackerService resourceTracker

webAppAddress

protected String webAppAddress
Constructor Detail

ResourceManager

public ResourceManager()
Method Detail

getRMContext

public RMContext getRMContext()

getClusterTimeStamp

public static long getClusterTimeStamp()

setClusterTimeStamp

protected static void setClusterTimeStamp(long timestamp)

serviceInit

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

createQueueACLsManager

protected QueueACLsManager createQueueACLsManager(ResourceScheduler scheduler,
                                                  org.apache.hadoop.conf.Configuration conf)

setRMStateStore

protected void setRMStateStore(RMStateStore rmStore)

createSchedulerEventDispatcher

protected org.apache.hadoop.yarn.event.EventHandler<SchedulerEvent> createSchedulerEventDispatcher()

createDispatcher

protected org.apache.hadoop.yarn.event.Dispatcher createDispatcher()

createScheduler

protected ResourceScheduler createScheduler()

createReservationSystem

protected ReservationSystem createReservationSystem()

createAMLauncher

protected ApplicationMasterLauncher createAMLauncher()

createAMLivelinessMonitor

protected AMLivelinessMonitor createAMLivelinessMonitor()

createNodeLabelManager

protected RMNodeLabelsManager createNodeLabelManager()
                                              throws InstantiationException,
                                                     IllegalAccessException
Throws:
InstantiationException
IllegalAccessException

createDelegationTokenRenewer

protected DelegationTokenRenewer createDelegationTokenRenewer()

createRMAppManager

protected RMAppManager createRMAppManager()

createRMApplicationHistoryWriter

protected RMApplicationHistoryWriter createRMApplicationHistoryWriter()

createSystemMetricsPublisher

protected SystemMetricsPublisher createSystemMetricsPublisher()

validateConfigs

protected static void validateConfigs(org.apache.hadoop.conf.Configuration conf)

handleTransitionToStandBy

public void handleTransitionToStandBy()

startWepApp

protected void startWepApp()

createAndInitActiveServices

protected void createAndInitActiveServices()
                                    throws Exception
Helper method to create and init activeServices. This creates an instance of ResourceManager.RMActiveServices and initializes it.

Throws:
Exception

areActiveServicesRunning

protected boolean areActiveServicesRunning()

serviceStart

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

doSecureLogin

protected void doSecureLogin()
                      throws IOException
Throws:
IOException

serviceStop

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

createResourceTrackerService

protected ResourceTrackerService createResourceTrackerService()

createClientRMService

protected ClientRMService createClientRMService()

createApplicationMasterService

protected ApplicationMasterService createApplicationMasterService()

createAdminService

protected AdminService createAdminService()

createRMSecretManagerService

protected RMSecretManagerService createRMSecretManagerService()

getClientRMService

@InterfaceAudience.Private
public ClientRMService getClientRMService()

getResourceScheduler

@InterfaceAudience.Private
public ResourceScheduler getResourceScheduler()
return the scheduler.

Returns:
the scheduler for the Resource Manager.

getResourceTrackerService

@InterfaceAudience.Private
public ResourceTrackerService getResourceTrackerService()
return the resource tracking component.

Returns:
the resource tracking component.

getApplicationMasterService

@InterfaceAudience.Private
public ApplicationMasterService getApplicationMasterService()

getApplicationACLsManager

@InterfaceAudience.Private
public org.apache.hadoop.yarn.server.security.ApplicationACLsManager getApplicationACLsManager()

getQueueACLsManager

@InterfaceAudience.Private
public QueueACLsManager getQueueACLsManager()

recover

public void recover(RMStateStore.RMState state)
             throws Exception
Specified by:
recover in interface Recoverable
Throws:
Exception

main

public static void main(String[] argv)

getBindAddress

public static InetSocketAddress getBindAddress(org.apache.hadoop.conf.Configuration conf)
Retrieve RM bind address from configuration

Parameters:
conf -
Returns:
InetSocketAddress


Copyright © 2014 Apache Software Foundation. All Rights Reserved.