@InterfaceAudience.Private @InterfaceStability.Unstable public class RMNodeImpl extends Object implements RMNode, org.apache.hadoop.yarn.event.EventHandler<RMNodeEvent>
Modifier and Type | Class and Description |
---|---|
static class |
RMNodeImpl.AddContainersToBeRemovedFromNMTransition |
static class |
RMNodeImpl.AddNodeTransition |
static class |
RMNodeImpl.CleanUpAppTransition |
static class |
RMNodeImpl.CleanUpContainerTransition |
static class |
RMNodeImpl.DeactivateNodeTransition |
static class |
RMNodeImpl.DecommissioningNodeTransition
The transition to put node in decommissioning state.
|
static class |
RMNodeImpl.RecommissionNodeTransition |
static class |
RMNodeImpl.ReconnectNodeTransition |
static class |
RMNodeImpl.SignalContainerTransition |
static class |
RMNodeImpl.StatusUpdateWhenHealthyTransition
Status update transition when node is healthy.
|
static class |
RMNodeImpl.StatusUpdateWhenUnHealthyTransition |
static class |
RMNodeImpl.UpdateContainersTransition
Transition to Update a container.
|
static class |
RMNodeImpl.UpdateNodeResourceWhenRunningTransition |
static class |
RMNodeImpl.UpdateNodeResourceWhenUnusableTransition |
Constructor and Description |
---|
RMNodeImpl(org.apache.hadoop.yarn.api.records.NodeId nodeId,
RMContext context,
String hostName,
int cmPort,
int httpPort,
org.apache.hadoop.net.Node node,
org.apache.hadoop.yarn.api.records.Resource capability,
String nodeManagerVersion) |
RMNodeImpl(org.apache.hadoop.yarn.api.records.NodeId nodeId,
RMContext context,
String hostName,
int cmPort,
int httpPort,
org.apache.hadoop.net.Node node,
org.apache.hadoop.yarn.api.records.Resource capability,
String nodeManagerVersion,
org.apache.hadoop.yarn.api.records.Resource physResource) |
Modifier and Type | Method and Description |
---|---|
long |
calculateHeartBeatInterval(long defaultInterval,
long minInterval,
long maxInterval,
float speedupFactor,
float slowdownFactor) |
static void |
deactivateNode(RMNodeImpl rmNode,
org.apache.hadoop.yarn.api.records.NodeState finalState)
Put a node in deactivated (decommissioned or shutdown) status.
|
org.apache.hadoop.yarn.api.records.ResourceUtilization |
getAggregatedContainersUtilization()
the aggregated resource utilization of the containers.
|
Set<org.apache.hadoop.yarn.api.records.NodeAttribute> |
getAllNodeAttributes() |
Map<String,Long> |
getAllocationTagsWithCount()
Get the allocation tags and their counts associated with this node.
|
List<org.apache.hadoop.yarn.api.records.ApplicationId> |
getAppsToCleanup() |
int |
getCommandPort()
the command port for this node
|
Set<org.apache.hadoop.yarn.api.records.ContainerId> |
getCompletedContainers() |
Set<org.apache.hadoop.yarn.api.records.ContainerId> |
getContainersToBeRemovedFromNM() |
List<org.apache.hadoop.yarn.api.records.ContainerId> |
getContainersToCleanUp() |
Integer |
getDecommissioningTimeout() |
String |
getHealthReport()
the latest health report received from this node.
|
String |
getHostName()
the hostname of this node
|
String |
getHttpAddress()
the http-Address for this node.
|
int |
getHttpPort()
the http port for this node
|
long |
getLastHealthReportTime()
the time of the latest health report received from this node.
|
org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse |
getLastNodeHeartBeatResponse() |
Set<org.apache.hadoop.yarn.api.records.ContainerId> |
getLaunchedContainers() |
org.apache.hadoop.net.Node |
getNode()
the
Node information for this node. |
String |
getNodeAddress()
the ContainerManager address for this node.
|
org.apache.hadoop.yarn.api.records.NodeId |
getNodeID()
the node id of of this node.
|
Set<String> |
getNodeLabels()
Get set of labels in this node
|
String |
getNodeManagerVersion()
the node manager version of the node received as part of the
registration with the resource manager
|
org.apache.hadoop.yarn.api.records.ResourceUtilization |
getNodeUtilization()
the total resource utilization of the node.
|
org.apache.hadoop.yarn.server.api.records.OpportunisticContainersStatus |
getOpportunisticContainersStatus() |
org.apache.hadoop.yarn.api.records.Resource |
getOriginalTotalCapability() |
org.apache.hadoop.yarn.api.records.Resource |
getPhysicalResource()
the physical resources in the node.
|
int |
getQueueSize() |
String |
getRackName()
The rack name for this node manager.
|
RMContext |
getRMContext() |
List<org.apache.hadoop.yarn.api.records.ApplicationId> |
getRunningApps() |
org.apache.hadoop.yarn.api.records.NodeState |
getState() |
Collection<org.apache.hadoop.yarn.api.records.Container> |
getToBeUpdatedContainers() |
org.apache.hadoop.yarn.api.records.Resource |
getTotalCapability()
the total available resource.
|
long |
getUntrackedTimeStamp() |
Map<org.apache.hadoop.yarn.api.records.ContainerId,org.apache.hadoop.yarn.api.records.ContainerStatus> |
getUpdatedExistContainers() |
void |
handle(RMNodeEvent event) |
boolean |
isUpdatedCapability()
If the total available resources has been updated.
|
List<UpdatedContainerInfo> |
pullContainerUpdates()
Get and clear the list of containerUpdates accumulated across NM
heartbeats.
|
List<org.apache.hadoop.yarn.api.records.Container> |
pullNewlyIncreasedContainers() |
static void |
reportNodeRunning(RMNodeImpl rmNode,
List<org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus> containers)
Report node is RUNNING.
|
static void |
reportNodeUnusable(RMNodeImpl rmNode,
org.apache.hadoop.yarn.api.records.NodeState finalState)
Report node is UNUSABLE and update metrics.
|
void |
resetLastNodeHeartBeatResponse()
Reset lastNodeHeartbeatResponse's ID to 0.
|
void |
resetUpdatedCapability()
Mark that the updated event has been processed.
|
void |
setAggregatedContainersUtilization(org.apache.hadoop.yarn.api.records.ResourceUtilization containersUtilization) |
void |
setAndUpdateNodeHeartbeatResponse(org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse response)
Update a
NodeHeartbeatResponse with the list of containers and
applications to clean up for this node, and the containers to be updated. |
void |
setHealthReport(String healthReport) |
void |
setHttpPort(int port) |
void |
setLastHealthReportTime(long lastHealthReportTime) |
void |
setNextHeartBeat(boolean nextHeartBeat) |
void |
setNodeUtilization(org.apache.hadoop.yarn.api.records.ResourceUtilization nodeUtilization) |
void |
setOpportunisticContainersStatus(org.apache.hadoop.yarn.server.api.records.OpportunisticContainersStatus opportunisticContainersStatus) |
void |
setPhysicalResource(org.apache.hadoop.yarn.api.records.Resource physicalResource) |
void |
setUntrackedTimeStamp(long ts) |
String |
toString() |
public RMNodeImpl(org.apache.hadoop.yarn.api.records.NodeId nodeId, RMContext context, String hostName, int cmPort, int httpPort, org.apache.hadoop.net.Node node, org.apache.hadoop.yarn.api.records.Resource capability, String nodeManagerVersion)
public RMNodeImpl(org.apache.hadoop.yarn.api.records.NodeId nodeId, RMContext context, String hostName, int cmPort, int httpPort, org.apache.hadoop.net.Node node, org.apache.hadoop.yarn.api.records.Resource capability, String nodeManagerVersion, org.apache.hadoop.yarn.api.records.Resource physResource)
public String getHostName()
RMNode
getHostName
in interface RMNode
public int getCommandPort()
RMNode
getCommandPort
in interface RMNode
public int getHttpPort()
RMNode
getHttpPort
in interface RMNode
public void setHttpPort(int port)
public org.apache.hadoop.yarn.api.records.NodeId getNodeID()
RMNode
public String getNodeAddress()
RMNode
getNodeAddress
in interface RMNode
public String getHttpAddress()
RMNode
getHttpAddress
in interface RMNode
public org.apache.hadoop.yarn.api.records.Resource getTotalCapability()
RMNode
getTotalCapability
in interface RMNode
public boolean isUpdatedCapability()
RMNode
isUpdatedCapability
in interface RMNode
public void resetUpdatedCapability()
RMNode
resetUpdatedCapability
in interface RMNode
public String getRackName()
RMNode
getRackName
in interface RMNode
public org.apache.hadoop.net.Node getNode()
RMNode
Node
information for this node.public String getHealthReport()
RMNode
getHealthReport
in interface RMNode
public void setHealthReport(String healthReport)
public void setLastHealthReportTime(long lastHealthReportTime)
public long getLastHealthReportTime()
RMNode
getLastHealthReportTime
in interface RMNode
public String getNodeManagerVersion()
RMNode
getNodeManagerVersion
in interface RMNode
public org.apache.hadoop.yarn.api.records.ResourceUtilization getAggregatedContainersUtilization()
RMNode
getAggregatedContainersUtilization
in interface RMNode
public void setAggregatedContainersUtilization(org.apache.hadoop.yarn.api.records.ResourceUtilization containersUtilization)
public org.apache.hadoop.yarn.api.records.ResourceUtilization getNodeUtilization()
RMNode
getNodeUtilization
in interface RMNode
public void setNodeUtilization(org.apache.hadoop.yarn.api.records.ResourceUtilization nodeUtilization)
public org.apache.hadoop.yarn.api.records.Resource getPhysicalResource()
RMNode
getPhysicalResource
in interface RMNode
public void setPhysicalResource(org.apache.hadoop.yarn.api.records.Resource physicalResource)
public org.apache.hadoop.yarn.api.records.NodeState getState()
public List<org.apache.hadoop.yarn.api.records.ApplicationId> getAppsToCleanup()
getAppsToCleanup
in interface RMNode
public List<org.apache.hadoop.yarn.api.records.ApplicationId> getRunningApps()
getRunningApps
in interface RMNode
public List<org.apache.hadoop.yarn.api.records.ContainerId> getContainersToCleanUp()
getContainersToCleanUp
in interface RMNode
public void setAndUpdateNodeHeartbeatResponse(org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse response)
RMNode
NodeHeartbeatResponse
with the list of containers and
applications to clean up for this node, and the containers to be updated.setAndUpdateNodeHeartbeatResponse
in interface RMNode
response
- the NodeHeartbeatResponse
to updatepublic Collection<org.apache.hadoop.yarn.api.records.Container> getToBeUpdatedContainers()
public org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse getLastNodeHeartBeatResponse()
getLastNodeHeartBeatResponse
in interface RMNode
public void resetLastNodeHeartBeatResponse()
RMNode
resetLastNodeHeartBeatResponse
in interface RMNode
public long calculateHeartBeatInterval(long defaultInterval, long minInterval, long maxInterval, float speedupFactor, float slowdownFactor)
calculateHeartBeatInterval
in interface RMNode
public void handle(RMNodeEvent event)
handle
in interface org.apache.hadoop.yarn.event.EventHandler<RMNodeEvent>
public static void deactivateNode(RMNodeImpl rmNode, org.apache.hadoop.yarn.api.records.NodeState finalState)
rmNode
- finalState
- public static void reportNodeRunning(RMNodeImpl rmNode, List<org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus> containers)
rmNode
- containers
- public static void reportNodeUnusable(RMNodeImpl rmNode, org.apache.hadoop.yarn.api.records.NodeState finalState)
rmNode
- finalState
- public List<UpdatedContainerInfo> pullContainerUpdates()
RMNode
pullContainerUpdates
in interface RMNode
public void setNextHeartBeat(boolean nextHeartBeat)
public int getQueueSize()
public Map<org.apache.hadoop.yarn.api.records.ContainerId,org.apache.hadoop.yarn.api.records.ContainerStatus> getUpdatedExistContainers()
public Set<org.apache.hadoop.yarn.api.records.ContainerId> getLaunchedContainers()
public Set<org.apache.hadoop.yarn.api.records.ContainerId> getCompletedContainers()
public Set<String> getNodeLabels()
RMNode
getNodeLabels
in interface RMNode
public List<org.apache.hadoop.yarn.api.records.Container> pullNewlyIncreasedContainers()
pullNewlyIncreasedContainers
in interface RMNode
public org.apache.hadoop.yarn.api.records.Resource getOriginalTotalCapability()
public org.apache.hadoop.yarn.server.api.records.OpportunisticContainersStatus getOpportunisticContainersStatus()
getOpportunisticContainersStatus
in interface RMNode
public void setOpportunisticContainersStatus(org.apache.hadoop.yarn.server.api.records.OpportunisticContainersStatus opportunisticContainersStatus)
public long getUntrackedTimeStamp()
getUntrackedTimeStamp
in interface RMNode
public void setUntrackedTimeStamp(long ts)
setUntrackedTimeStamp
in interface RMNode
public Integer getDecommissioningTimeout()
getDecommissioningTimeout
in interface RMNode
public Map<String,Long> getAllocationTagsWithCount()
RMNode
getAllocationTagsWithCount
in interface RMNode
public RMContext getRMContext()
getRMContext
in interface RMNode
public Set<org.apache.hadoop.yarn.api.records.NodeAttribute> getAllNodeAttributes()
getAllNodeAttributes
in interface RMNode
public Set<org.apache.hadoop.yarn.api.records.ContainerId> getContainersToBeRemovedFromNM()
Copyright © 2008–2021 Apache Software Foundation. All rights reserved.