Class NodesListManager

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.yarn.server.resourcemanager.NodesListManager
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.service.Service, org.apache.hadoop.yarn.event.EventHandler<NodesListManagerEvent>

public class NodesListManager extends org.apache.hadoop.service.CompositeService implements org.apache.hadoop.yarn.event.EventHandler<NodesListManagerEvent>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     
    static interface 
     

    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 inherited from class org.apache.hadoop.service.CompositeService

    STOP_ONLY_STARTED_SERVICES
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<org.apache.hadoop.yarn.api.records.NodeId>
    It checks for any nodes in decommissioning state
    static org.apache.hadoop.yarn.api.records.NodeId
    Creates a NodeId for a node marked as LOST.
    static org.apache.hadoop.yarn.api.records.NodeId
    A NodeId instance needed upon startup for populating inactive nodes Map.
    org.apache.hadoop.util.HostsFileReader
     
    int
     
     
    void
     
    boolean
     
    boolean
    isValidNode(String hostName)
     
    void
    refreshNodes(org.apache.hadoop.conf.Configuration yarnConf)
     
    void
    refreshNodes(org.apache.hadoop.conf.Configuration yarnConf, boolean graceful)
     
    void
    Forcefully decommission the nodes if they are in DECOMMISSIONING state
    void
    refreshNodesGracefully(org.apache.hadoop.conf.Configuration yarnConf, Integer timeout)
    Refresh the nodes gracefully.
    protected void
    serviceInit(org.apache.hadoop.conf.Configuration conf)
     
    void
     
    void
     

    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, 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
  • Constructor Details

    • NodesListManager

      public NodesListManager(RMContext rmContext)
  • Method Details

    • serviceInit

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

      public void serviceStop()
      Overrides:
      serviceStop in class org.apache.hadoop.service.CompositeService
    • refreshNodes

      public void refreshNodes(org.apache.hadoop.conf.Configuration yarnConf) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
      Throws:
      IOException
      org.apache.hadoop.yarn.exceptions.YarnException
    • refreshNodes

      public void refreshNodes(org.apache.hadoop.conf.Configuration yarnConf, boolean graceful) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
      Throws:
      IOException
      org.apache.hadoop.yarn.exceptions.YarnException
    • getNodeRemovalCheckInterval

      @VisibleForTesting public int getNodeRemovalCheckInterval()
    • setNodeRemovalCheckInterval

      @VisibleForTesting public void setNodeRemovalCheckInterval(int interval)
    • getResolver

      @VisibleForTesting public NodesListManager.Resolver getResolver()
    • isValidNode

      public boolean isValidNode(String hostName)
    • handle

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

      @VisibleForTesting public org.apache.hadoop.util.HostsFileReader getHostsReader()
    • isUntrackedNode

      public boolean isUntrackedNode(String hostName)
    • refreshNodesGracefully

      public void refreshNodesGracefully(org.apache.hadoop.conf.Configuration yarnConf, Integer timeout) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
      Refresh the nodes gracefully.
      Parameters:
      yarnConf - yarn configuration.
      timeout - decommission timeout, null means default timeout.
      Throws:
      IOException - io error occur.
      org.apache.hadoop.yarn.exceptions.YarnException - exceptions from yarn servers.
    • checkForDecommissioningNodes

      public Set<org.apache.hadoop.yarn.api.records.NodeId> checkForDecommissioningNodes()
      It checks for any nodes in decommissioning state
      Returns:
      decommissioning nodes
    • refreshNodesForcefully

      public void refreshNodesForcefully()
      Forcefully decommission the nodes if they are in DECOMMISSIONING state
    • createUnknownNodeId

      public static org.apache.hadoop.yarn.api.records.NodeId createUnknownNodeId(String host)
      A NodeId instance needed upon startup for populating inactive nodes Map. It only knows the hostname/ip and marks the port to -1 or invalid.
      Parameters:
      host - host name.
      Returns:
      node id.
    • createLostNodeId

      public static org.apache.hadoop.yarn.api.records.NodeId createLostNodeId(String host)
      Creates a NodeId for a node marked as LOST. The NodeId combines the hostname with a special port value of -2, indicating that the node is lost in the cluster.
      Parameters:
      host - The hostname of the lost node.
      Returns:
      NodeId Unique identifier for the lost node, with the port set to -2.