org.apache.hadoop.yarn.server.nodemanager

## 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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `NodeManager.DefaultContainerStateListener` Default Container State transition listener.
    `static class` | `NodeManager.NMContext`
    `static class` | `NodeManager.NodeManagerStatus` Node manager return status codes.

    - ### 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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected NodeManagerMetrics` | `metrics`
    `static int` | `SHUTDOWN_HOOK_PRIORITY` Priority of the NodeManager shutdown hook.

    - ### Fields inherited from class org.apache.hadoop.service.CompositeService

      `STOP_ONLY_STARTED_SERVICES`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NodeManager()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected ContainerExecutor` | `createContainerExecutor(org.apache.hadoop.conf.Configuration conf)`
    `protected ContainerManagerImpl` | `createContainerManager(Context context, ContainerExecutor exec, DeletionService del, NodeStatusUpdater nodeStatusUpdater, org.apache.hadoop.yarn.server.security.ApplicationACLsManager aclsManager, LocalDirsHandlerService dirsHandler)`
    `protected DeletionService` | `createDeletionService(ContainerExecutor exec)`
    `protected NMCollectorService` | `createNMCollectorService(Context ctxt)`
    `protected NodeManager.NMContext` | `createNMContext(NMContainerTokenSecretManager containerTokenSecretManager, NMTokenSecretManagerInNM nmTokenSecretManager, NMStateStoreService stateStore, boolean isDistSchedulerEnabled, org.apache.hadoop.conf.Configuration conf)`
    `protected org.apache.hadoop.yarn.event.AsyncDispatcher` | `createNMDispatcher()` Unit test friendly.
    `protected NodeAttributesProvider` | `createNodeAttributesProvider(org.apache.hadoop.conf.Configuration conf)`
    `protected NodeLabelsProvider` | `createNodeLabelsProvider(org.apache.hadoop.conf.Configuration conf)`
    `protected NodeResourceMonitor` | `createNodeResourceMonitor()`
    `protected NodeStatusUpdater` | `createNodeStatusUpdater(Context context, org.apache.hadoop.yarn.event.Dispatcher dispatcher, NodeHealthCheckerService healthChecker)`
    `protected ResourcePluginManager` | `createResourcePluginManager()`
    `protected WebServer` | `createWebServer(Context nmContext, ResourceView resourceView, org.apache.hadoop.yarn.server.security.ApplicationACLsManager aclsManager, LocalDirsHandlerService dirsHandler)`
    `protected void` | `doSecureLogin()`
    `String` | `getName()`
    `Context` | `getNMContext()`
    `static long` | `getNMStartupTime()`
    `NodeHealthCheckerService` | `getNodeHealthChecker()`
    `static org.apache.hadoop.util.NodeHealthScriptRunner` | `getNodeHealthScriptRunner(org.apache.hadoop.conf.Configuration conf)`
    `NodeStatusUpdater` | `getNodeStatusUpdater()`
    `void` | `handle(NodeManagerEvent event)`
    `boolean` | `isSecurityEnabled()` Gets if security is enabled.
    `static void` | `main(String[] args)`
    `protected void` | `reregisterCollectors()` Reregisters all collectors known by this node to the RM.
    `protected void` | `resyncWithRM()`
    `protected void` | `serviceInit(org.apache.hadoop.conf.Configuration conf)`
    `protected void` | `serviceStop()`
    `protected void` | `shutDown(int exitCode)`

    - ### Methods inherited from class org.apache.hadoop.service.CompositeService

      `addIfService, addService, getServices, removeService, serviceStart`

    - ### Methods inherited from class org.apache.hadoop.service.AbstractService

      `close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, 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 NodeManager shutdown hook.
      See Also:
        Constant Field Values

    - #### metrics

          protected final NodeManagerMetrics metrics

  - ### Constructor Detail

    - #### NodeManager

          public NodeManager()

  - ### Method Detail

    - #### 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`

    - #### getNodeHealthScriptRunner

          public static org.apache.hadoop.util.NodeHealthScriptRunner getNodeHealthScriptRunner(org.apache.hadoop.conf.Configuration conf)

    - #### createResourcePluginManager

          protected ResourcePluginManager createResourcePluginManager()

    - #### createContainerExecutor

          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

          public Context getNMContext()

    - #### main

          public static void main(String[] args)
                           throws IOException

      Throws:
        `IOException`

    - #### getNodeStatusUpdater

          @InterfaceAudience.Private
          public NodeStatusUpdater getNodeStatusUpdater()

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.