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 ClassesModifier and TypeClassDescriptionstatic classstatic classstatic interfaceNested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService
org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHookNested 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 -
Method Summary
Modifier and TypeMethodDescriptionSet<org.apache.hadoop.yarn.api.records.NodeId>It checks for any nodes in decommissioning statestatic org.apache.hadoop.yarn.api.records.NodeIdcreateLostNodeId(String host) Creates a NodeId for a node marked as LOST.static org.apache.hadoop.yarn.api.records.NodeIdcreateUnknownNodeId(String host) A NodeId instance needed upon startup for populating inactive nodes Map.org.apache.hadoop.util.HostsFileReaderintvoidhandle(NodesListManagerEvent event) booleanisUntrackedNode(String hostName) booleanisValidNode(String hostName) voidrefreshNodes(org.apache.hadoop.conf.Configuration yarnConf) voidrefreshNodes(org.apache.hadoop.conf.Configuration yarnConf, boolean graceful) voidForcefully decommission the nodes if they are in DECOMMISSIONING statevoidrefreshNodesGracefully(org.apache.hadoop.conf.Configuration yarnConf, Integer timeout) Refresh the nodes gracefully.protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) voidvoidsetNodeRemovalCheckInterval(int interval) Methods inherited from class org.apache.hadoop.service.CompositeService
addIfService, addService, getServices, removeService, serviceStartMethods 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
-
Constructor Details
-
NodesListManager
-
-
Method Details
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
serviceStop
public void serviceStop()- Overrides:
serviceStopin classorg.apache.hadoop.service.CompositeService
-
refreshNodes
public void refreshNodes(org.apache.hadoop.conf.Configuration yarnConf) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException - Throws:
IOExceptionorg.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:
IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException
-
getNodeRemovalCheckInterval
@VisibleForTesting public int getNodeRemovalCheckInterval() -
setNodeRemovalCheckInterval
@VisibleForTesting public void setNodeRemovalCheckInterval(int interval) -
getResolver
-
isValidNode
-
handle
- Specified by:
handlein interfaceorg.apache.hadoop.yarn.event.EventHandler<NodesListManagerEvent>
-
getHostsReader
@VisibleForTesting public org.apache.hadoop.util.HostsFileReader getHostsReader() -
isUntrackedNode
-
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
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
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
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.
-