org.apache.hadoop.yarn.server.nodemanager

## Class NodeStatusUpdaterImpl

- java.lang.Object
- - org.apache.hadoop.service.AbstractService
  - - org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl

- All Implemented Interfaces:
    Closeable, AutoCloseable, org.apache.hadoop.service.Service, NodeStatusUpdater

      public class NodeStatusUpdaterImpl
      extends org.apache.hadoop.service.AbstractService
      implements NodeStatusUpdater

- - ### Nested Class Summary

    - ### 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
    --- | ---
    `static String` | `YARN_NODEMANAGER_DURATION_TO_TRACK_STOPPED_CONTAINERS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NodeStatusUpdaterImpl(Context context, org.apache.hadoop.yarn.event.Dispatcher dispatcher, NodeHealthCheckerService healthChecker, NodeManagerMetrics metrics)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCompletedContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)` Add a container to the list of containers that have recently completed
    `void` | `clearFinishedContainersFromCache()` Clear the list of recently completed containers
    `protected List<org.apache.hadoop.yarn.api.records.ContainerStatus>` | `getContainerStatuses()`
    `protected org.apache.hadoop.yarn.server.api.records.NodeStatus` | `getNodeStatus(int responseId)`
    `protected org.apache.hadoop.yarn.server.api.ResourceTracker` | `getRMClient()`
    `long` | `getRMIdentifier()` Get the ResourceManager identifier received during registration
    `boolean` | `isContainerRecentlyStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId)` Query if a container has recently completed
    `protected boolean` | `isTokenKeepAliveEnabled(org.apache.hadoop.conf.Configuration conf)`
    `protected void` | `rebootNodeStatusUpdaterAndRegisterWithRM()`
    `protected void` | `registerWithRM()`
    `void` | `removeOrTrackCompletedContainersFromContext(List<org.apache.hadoop.yarn.api.records.ContainerId> containerIds)`
    `void` | `removeVeryOldStoppedContainersFromCache()`
    `void` | `reportException(Exception ex)` Report an unrecoverable exception.
    `void` | `sendOutofBandHeartBeat()` Schedule a heartbeat to the ResourceManager outside of the normal, periodic heartbeating process.
    `protected void` | `serviceInit(org.apache.hadoop.conf.Configuration conf)`
    `protected void` | `serviceStart()`
    `protected void` | `serviceStop()`
    `void` | `setNodeAttributesProvider(NodeAttributesProvider provider)` Sets a node attributes provider to node manager.
    `void` | `setNodeLabelsProvider(NodeLabelsProvider provider)` Sets a node labels provider to the node manager.
    `protected void` | `startStatusUpdater()`
    `protected void` | `stopRMProxy()`

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

    - ### Methods inherited from interface org.apache.hadoop.service.Service

      `close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStop`

- - ### Field Detail

    - #### YARN_NODEMANAGER_DURATION_TO_TRACK_STOPPED_CONTAINERS

          public static final String YARN_NODEMANAGER_DURATION_TO_TRACK_STOPPED_CONTAINERS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### NodeStatusUpdaterImpl

          public NodeStatusUpdaterImpl(Context context,
                                       org.apache.hadoop.yarn.event.Dispatcher dispatcher,
                                       NodeHealthCheckerService healthChecker,
                                       NodeManagerMetrics metrics)

  - ### Method Detail

    - #### setNodeAttributesProvider

          public void setNodeAttributesProvider(NodeAttributesProvider provider)

      Description copied from interface: `NodeStatusUpdater`
      Sets a node attributes provider to node manager.
      Specified by:
        `setNodeAttributesProvider` in interface `NodeStatusUpdater`

    - #### setNodeLabelsProvider

          public void setNodeLabelsProvider(NodeLabelsProvider provider)

      Description copied from interface: `NodeStatusUpdater`
      Sets a node labels provider to the node manager.
      Specified by:
        `setNodeLabelsProvider` in interface `NodeStatusUpdater`

    - #### serviceInit

          protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
                              throws Exception

      Overrides:
        `serviceInit` in class `org.apache.hadoop.service.AbstractService`
      Throws:
        `Exception`

    - #### serviceStart

          protected void serviceStart()
                               throws Exception

      Overrides:
        `serviceStart` in class `org.apache.hadoop.service.AbstractService`
      Throws:
        `Exception`

    - #### serviceStop

          protected void serviceStop()
                              throws Exception

      Overrides:
        `serviceStop` in class `org.apache.hadoop.service.AbstractService`
      Throws:
        `Exception`

    - #### rebootNodeStatusUpdaterAndRegisterWithRM

          protected void rebootNodeStatusUpdaterAndRegisterWithRM()

    - #### stopRMProxy

          protected void stopRMProxy()

    - #### isTokenKeepAliveEnabled

          @InterfaceAudience.Private
          protected boolean isTokenKeepAliveEnabled(org.apache.hadoop.conf.Configuration conf)

    - #### getRMClient

          protected org.apache.hadoop.yarn.server.api.ResourceTracker getRMClient()
                                                                           throws IOException

      Throws:
        `IOException`

    - #### registerWithRM

          protected void registerWithRM()
                                 throws org.apache.hadoop.yarn.exceptions.YarnException,
                                        IOException

      Throws:
        `org.apache.hadoop.yarn.exceptions.YarnException`
        `IOException`

    - #### getNodeStatus

          protected org.apache.hadoop.yarn.server.api.records.NodeStatus getNodeStatus(int responseId)
                                                                                throws IOException

      Throws:
        `IOException`

    - #### getContainerStatuses

          protected List<org.apache.hadoop.yarn.api.records.ContainerStatus> getContainerStatuses()
                                                                                           throws IOException

      Throws:
        `IOException`

    - #### addCompletedContainer

          public void addCompletedContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)

      Description copied from interface: `NodeStatusUpdater`
      Add a container to the list of containers that have recently completed
      Specified by:
        `addCompletedContainer` in interface `NodeStatusUpdater`
      Parameters:
        `containerId` - the ID of the completed container

    - #### removeOrTrackCompletedContainersFromContext

          @InterfaceAudience.Private
          public void removeOrTrackCompletedContainersFromContext(List<org.apache.hadoop.yarn.api.records.ContainerId> containerIds)

    - #### sendOutofBandHeartBeat

          public void sendOutofBandHeartBeat()

      Description copied from interface: `NodeStatusUpdater`
      Schedule a heartbeat to the ResourceManager outside of the normal, periodic heartbeating process. This is typically called when the state of containers on the node has changed to notify the RM sooner.
      Specified by:
        `sendOutofBandHeartBeat` in interface `NodeStatusUpdater`

    - #### isContainerRecentlyStopped

          public boolean isContainerRecentlyStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId)

      Description copied from interface: `NodeStatusUpdater`
      Query if a container has recently completed
      Specified by:
        `isContainerRecentlyStopped` in interface `NodeStatusUpdater`
      Parameters:
        `containerId` - the container ID
      Returns:
        true if the container has recently completed

    - #### clearFinishedContainersFromCache

          public void clearFinishedContainersFromCache()

      Description copied from interface: `NodeStatusUpdater`
      Clear the list of recently completed containers
      Specified by:
        `clearFinishedContainersFromCache` in interface `NodeStatusUpdater`

    - #### removeVeryOldStoppedContainersFromCache

          @InterfaceAudience.Private
          public void removeVeryOldStoppedContainersFromCache()

    - #### getRMIdentifier

          public long getRMIdentifier()

      Description copied from interface: `NodeStatusUpdater`
      Get the ResourceManager identifier received during registration
      Specified by:
        `getRMIdentifier` in interface `NodeStatusUpdater`
      Returns:
        the ResourceManager ID

    - #### startStatusUpdater

          protected void startStatusUpdater()

    - #### reportException

          public void reportException(Exception ex)

      Description copied from interface: `NodeStatusUpdater`
      Report an unrecoverable exception.
      Specified by:
        `reportException` in interface `NodeStatusUpdater`
      Parameters:
        `ex` - exception that makes the node unhealthy

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