Class NodeManager

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.yarn.server.nodemanager.NodeManager
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.service.Service, org.apache.hadoop.yarn.event.EventHandler<NodeManagerEvent>, NodeManagerMXBean

public class NodeManager extends org.apache.hadoop.service.CompositeService implements org.apache.hadoop.yarn.event.EventHandler<NodeManagerEvent>, NodeManagerMXBean
  • Field Details

    • SHUTDOWN_HOOK_PRIORITY

      public static final int SHUTDOWN_HOOK_PRIORITY
      Priority of the NodeManager shutdown hook.
      See Also:
    • metrics

      protected final NodeManagerMetrics metrics
  • Constructor Details

    • NodeManager

      public NodeManager()
  • Method Details

    • getNMStartupTime

      public static long getNMStartupTime()
    • createNodeStatusUpdater

      protected NodeStatusUpdater createNodeStatusUpdater(Context context, org.apache.hadoop.yarn.event.Dispatcher dispatcher, NodeHealthCheckerService healthChecker)
    • createNodeAttributesProvider

      protected NodeAttributesProvider createNodeAttributesProvider(org.apache.hadoop.conf.Configuration conf) throws IOException
      Throws:
      IOException
    • createNodeLabelsProvider

      protected NodeLabelsProvider createNodeLabelsProvider(org.apache.hadoop.conf.Configuration conf) throws IOException
      Throws:
      IOException
    • createNodeResourceMonitor

      protected NodeResourceMonitor createNodeResourceMonitor()
    • createContainerManager

      protected ContainerManagerImpl createContainerManager(Context context, ContainerExecutor exec, DeletionService del, NodeStatusUpdater nodeStatusUpdater, org.apache.hadoop.yarn.server.security.ApplicationACLsManager aclsManager, LocalDirsHandlerService dirsHandler)
    • createNMCollectorService

      protected NMCollectorService createNMCollectorService(Context ctxt)
    • createWebServer

      protected WebServer createWebServer(Context nmContext, ResourceView resourceView, org.apache.hadoop.yarn.server.security.ApplicationACLsManager aclsManager, LocalDirsHandlerService dirsHandler)
    • createDeletionService

      protected DeletionService createDeletionService(ContainerExecutor exec)
    • createNMContext

      protected NodeManager.NMContext createNMContext(NMContainerTokenSecretManager containerTokenSecretManager, NMTokenSecretManagerInNM nmTokenSecretManager, NMStateStoreService stateStore, boolean isDistSchedulerEnabled, org.apache.hadoop.conf.Configuration conf)
    • doSecureLogin

      protected void doSecureLogin() throws IOException
      Throws:
      IOException
    • createResourcePluginManager

      @VisibleForTesting protected ResourcePluginManager createResourcePluginManager()
    • createContainerExecutor

      @VisibleForTesting protected ContainerExecutor createContainerExecutor(org.apache.hadoop.conf.Configuration conf)
    • serviceInit

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

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

      public String getName()
      Specified by:
      getName in interface org.apache.hadoop.service.Service
      Overrides:
      getName in class org.apache.hadoop.service.AbstractService
    • shutDown

      protected void shutDown(int exitCode)
    • resyncWithRM

      protected void resyncWithRM()
    • reregisterCollectors

      protected void reregisterCollectors()
      Reregisters all collectors known by this node to the RM. This method is called when the RM needs to resync with the node.
    • getNodeHealthChecker

      public NodeHealthCheckerService getNodeHealthChecker()
      Returns:
      the node health checker
    • handle

      public void handle(NodeManagerEvent event)
      Specified by:
      handle in interface org.apache.hadoop.yarn.event.EventHandler<NodeManagerEvent>
    • isSecurityEnabled

      public boolean isSecurityEnabled()
      Description copied from interface: NodeManagerMXBean
      Gets if security is enabled.
      Specified by:
      isSecurityEnabled in interface NodeManagerMXBean
      Returns:
      true, if security is enabled.
    • createNMDispatcher

      protected org.apache.hadoop.yarn.event.AsyncDispatcher createNMDispatcher()
      Unit test friendly.
    • getNMContext

      @VisibleForTesting public Context getNMContext()
    • main

      public static void main(String[] args) throws IOException
      Throws:
      IOException
    • getNodeStatusUpdater

      @VisibleForTesting @Private public NodeStatusUpdater getNodeStatusUpdater()
    • getDispatcher

      @VisibleForTesting @Private public org.apache.hadoop.yarn.event.AsyncDispatcher getDispatcher()
    • disableWebServer

      @VisibleForTesting public void disableWebServer()