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 ClassesModifier and TypeClassDescriptionstatic classDefault Container State transition listener.static classstatic enumNode manager return status codes.Nested 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
FieldsModifier and TypeFieldDescriptionprotected final NodeManagerMetricsstatic final intPriority of the NodeManager shutdown hook.Fields inherited from class org.apache.hadoop.service.CompositeService
STOP_ONLY_STARTED_SERVICES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ContainerExecutorcreateContainerExecutor(org.apache.hadoop.conf.Configuration conf) protected ContainerManagerImplcreateContainerManager(Context context, ContainerExecutor exec, DeletionService del, NodeStatusUpdater nodeStatusUpdater, org.apache.hadoop.yarn.server.security.ApplicationACLsManager aclsManager, LocalDirsHandlerService dirsHandler) protected DeletionServiceprotected NMCollectorServiceprotected NodeManager.NMContextcreateNMContext(NMContainerTokenSecretManager containerTokenSecretManager, NMTokenSecretManagerInNM nmTokenSecretManager, NMStateStoreService stateStore, boolean isDistSchedulerEnabled, org.apache.hadoop.conf.Configuration conf) protected org.apache.hadoop.yarn.event.AsyncDispatcherUnit test friendly.protected NodeAttributesProvidercreateNodeAttributesProvider(org.apache.hadoop.conf.Configuration conf) protected NodeLabelsProvidercreateNodeLabelsProvider(org.apache.hadoop.conf.Configuration conf) protected NodeResourceMonitorprotected NodeStatusUpdatercreateNodeStatusUpdater(Context context, org.apache.hadoop.yarn.event.Dispatcher dispatcher, NodeHealthCheckerService healthChecker) protected ResourcePluginManagerprotected WebServercreateWebServer(Context nmContext, ResourceView resourceView, org.apache.hadoop.yarn.server.security.ApplicationACLsManager aclsManager, LocalDirsHandlerService dirsHandler) voidprotected voidorg.apache.hadoop.yarn.event.AsyncDispatchergetName()static longvoidhandle(NodeManagerEvent event) booleanGets if security is enabled.static voidprotected voidReregisters all collectors known by this node to the RM.protected voidprotected voidserviceInit(org.apache.hadoop.conf.Configuration conf) protected voidprotected voidshutDown(int exitCode) 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, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Field Details
-
SHUTDOWN_HOOK_PRIORITY
public static final int SHUTDOWN_HOOK_PRIORITYPriority of the NodeManager shutdown hook.- See Also:
-
metrics
-
-
Constructor Details
-
NodeManager
public NodeManager()
-
-
Method Details
-
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
-
createContainerManager
protected ContainerManagerImpl createContainerManager(Context context, ContainerExecutor exec, DeletionService del, NodeStatusUpdater nodeStatusUpdater, org.apache.hadoop.yarn.server.security.ApplicationACLsManager aclsManager, LocalDirsHandlerService dirsHandler) -
createNMCollectorService
-
createWebServer
protected WebServer createWebServer(Context nmContext, ResourceView resourceView, org.apache.hadoop.yarn.server.security.ApplicationACLsManager aclsManager, LocalDirsHandlerService dirsHandler) -
createDeletionService
-
createNMContext
protected NodeManager.NMContext createNMContext(NMContainerTokenSecretManager containerTokenSecretManager, NMTokenSecretManagerInNM nmTokenSecretManager, NMStateStoreService stateStore, boolean isDistSchedulerEnabled, org.apache.hadoop.conf.Configuration conf) -
doSecureLogin
- Throws:
IOException
-
createResourcePluginManager
-
createContainerExecutor
@VisibleForTesting protected ContainerExecutor createContainerExecutor(org.apache.hadoop.conf.Configuration conf) -
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
serviceStop
- Overrides:
serviceStopin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
getName
- Specified by:
getNamein interfaceorg.apache.hadoop.service.Service- Overrides:
getNamein classorg.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
- Returns:
- the node health checker
-
handle
- Specified by:
handlein interfaceorg.apache.hadoop.yarn.event.EventHandler<NodeManagerEvent>
-
isSecurityEnabled
public boolean isSecurityEnabled()Description copied from interface:NodeManagerMXBeanGets if security is enabled.- Specified by:
isSecurityEnabledin interfaceNodeManagerMXBean- Returns:
- true, if security is enabled.
-
createNMDispatcher
protected org.apache.hadoop.yarn.event.AsyncDispatcher createNMDispatcher()Unit test friendly. -
getNMContext
-
main
- Throws:
IOException
-
getNodeStatusUpdater
-
getDispatcher
@VisibleForTesting @Private public org.apache.hadoop.yarn.event.AsyncDispatcher getDispatcher() -
disableWebServer
@VisibleForTesting public void disableWebServer()
-