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
  • Field Details

    • YARN_NODEMANAGER_DURATION_TO_TRACK_STOPPED_CONTAINERS

      public static final String YARN_NODEMANAGER_DURATION_TO_TRACK_STOPPED_CONTAINERS
      See Also:
  • Constructor Details

  • Method Details

    • 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

      @VisibleForTesting protected void stopRMProxy()
    • isTokenKeepAliveEnabled

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

      @VisibleForTesting protected org.apache.hadoop.yarn.server.api.ResourceTracker getRMClient() throws IOException
      Throws:
      IOException
    • registerWithRM

      @VisibleForTesting protected void registerWithRM() throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
      IOException
    • getNodeStatus

      @VisibleForTesting protected org.apache.hadoop.yarn.server.api.records.NodeStatus getNodeStatus(int responseId) throws IOException
      Throws:
      IOException
    • getContainerStatuses

      @VisibleForTesting 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

      @VisibleForTesting @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

      @Private @VisibleForTesting 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