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 -
Constructor Summary
ConstructorsConstructorDescriptionNodeStatusUpdaterImpl(Context context, org.apache.hadoop.yarn.event.Dispatcher dispatcher, NodeHealthCheckerService healthChecker, NodeManagerMetrics metrics) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCompletedContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) Add a container to the list of containers that have recently completedvoidClear the list of recently completed containersprotected List<org.apache.hadoop.yarn.api.records.ContainerStatus>protected org.apache.hadoop.yarn.server.api.records.NodeStatusgetNodeStatus(int responseId) protected org.apache.hadoop.yarn.server.api.ResourceTrackerlongGet the ResourceManager identifier received during registrationbooleanisContainerRecentlyStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId) Query if a container has recently completedprotected booleanisTokenKeepAliveEnabled(org.apache.hadoop.conf.Configuration conf) protected voidprotected voidvoidremoveOrTrackCompletedContainersFromContext(List<org.apache.hadoop.yarn.api.records.ContainerId> containerIds) voidvoidReport an unrecoverable exception.voidSchedule a heartbeat to the ResourceManager outside of the normal, periodic heartbeating process.protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) protected voidprotected voidvoidSets a node attributes provider to node manager.voidsetNodeLabelsProvider(NodeLabelsProvider provider) Sets a node labels provider to the node manager.protected voidprotected voidMethods 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, waitForServiceToStopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 Details
-
YARN_NODEMANAGER_DURATION_TO_TRACK_STOPPED_CONTAINERS
- See Also:
-
-
Constructor Details
-
NodeStatusUpdaterImpl
public NodeStatusUpdaterImpl(Context context, org.apache.hadoop.yarn.event.Dispatcher dispatcher, NodeHealthCheckerService healthChecker, NodeManagerMetrics metrics)
-
-
Method Details
-
setNodeAttributesProvider
Description copied from interface:NodeStatusUpdaterSets a node attributes provider to node manager.- Specified by:
setNodeAttributesProviderin interfaceNodeStatusUpdater
-
setNodeLabelsProvider
Description copied from interface:NodeStatusUpdaterSets a node labels provider to the node manager.- Specified by:
setNodeLabelsProviderin interfaceNodeStatusUpdater
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
serviceStart
- Overrides:
serviceStartin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
serviceStop
- Overrides:
serviceStopin classorg.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.YarnExceptionIOException
-
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:NodeStatusUpdaterAdd a container to the list of containers that have recently completed- Specified by:
addCompletedContainerin interfaceNodeStatusUpdater- 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:NodeStatusUpdaterSchedule 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:
sendOutofBandHeartBeatin interfaceNodeStatusUpdater
-
isContainerRecentlyStopped
public boolean isContainerRecentlyStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId) Description copied from interface:NodeStatusUpdaterQuery if a container has recently completed- Specified by:
isContainerRecentlyStoppedin interfaceNodeStatusUpdater- Parameters:
containerId- the container ID- Returns:
- true if the container has recently completed
-
clearFinishedContainersFromCache
public void clearFinishedContainersFromCache()Description copied from interface:NodeStatusUpdaterClear the list of recently completed containers- Specified by:
clearFinishedContainersFromCachein interfaceNodeStatusUpdater
-
removeVeryOldStoppedContainersFromCache
@Private @VisibleForTesting public void removeVeryOldStoppedContainersFromCache() -
getRMIdentifier
public long getRMIdentifier()Description copied from interface:NodeStatusUpdaterGet the ResourceManager identifier received during registration- Specified by:
getRMIdentifierin interfaceNodeStatusUpdater- Returns:
- the ResourceManager ID
-
startStatusUpdater
protected void startStatusUpdater() -
reportException
Description copied from interface:NodeStatusUpdaterReport an unrecoverable exception.- Specified by:
reportExceptionin interfaceNodeStatusUpdater- Parameters:
ex- exception that makes the node unhealthy
-