org.apache.hadoop.yarn.server.resourcemanager.rmnode
Class RMNodeImpl

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl
All Implemented Interfaces:
org.apache.hadoop.yarn.event.EventHandler<RMNodeEvent>, RMNode

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class RMNodeImpl
extends Object
implements RMNode, org.apache.hadoop.yarn.event.EventHandler<RMNodeEvent>

This class is used to keep track of all the applications/containers running on a node.


Nested Class Summary
static class RMNodeImpl.AddNodeTransition
           
static class RMNodeImpl.CleanUpAppTransition
           
static class RMNodeImpl.CleanUpContainerTransition
           
static class RMNodeImpl.DeactivateNodeTransition
           
static class RMNodeImpl.ReconnectNodeTransition
           
static class RMNodeImpl.StatusUpdateWhenHealthyTransition
           
static class RMNodeImpl.StatusUpdateWhenUnHealthyTransition
           
 
Constructor Summary
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)
           
 
Method Summary
 List<org.apache.hadoop.yarn.api.records.ApplicationId> getAppsToCleanup()
           
 int getCommandPort()
          the command port for this node
 List<org.apache.hadoop.yarn.api.records.ContainerId> getContainersToCleanUp()
           
 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()
           
 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.
 int getQueueSize()
           
 String getRackName()
          The rack name for this node manager.
 org.apache.hadoop.yarn.api.records.NodeState getState()
           
 org.apache.hadoop.yarn.api.records.Resource getTotalCapability()
          the total available resource.
 void handle(RMNodeEvent event)
           
 List<UpdatedContainerInfo> pullContainerUpdates()
          Get and clear the list of containerUpdates accumulated across NM heartbeats.
 void setHealthReport(String healthReport)
           
 void setLastHealthReportTime(long lastHealthReportTime)
           
 void setNextHeartBeat(boolean nextHeartBeat)
           
 String toString()
           
 void updateNodeHeartbeatResponseForCleanup(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RMNodeImpl

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)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getHostName

public String getHostName()
Description copied from interface: RMNode
the hostname of this node

Specified by:
getHostName in interface RMNode
Returns:
hostname of this node

getCommandPort

public int getCommandPort()
Description copied from interface: RMNode
the command port for this node

Specified by:
getCommandPort in interface RMNode
Returns:
command port for this node

getHttpPort

public int getHttpPort()
Description copied from interface: RMNode
the http port for this node

Specified by:
getHttpPort in interface RMNode
Returns:
http port for this node

getNodeID

public org.apache.hadoop.yarn.api.records.NodeId getNodeID()
Description copied from interface: RMNode
the node id of of this node.

Specified by:
getNodeID in interface RMNode
Returns:
the node id of this node.

getNodeAddress

public String getNodeAddress()
Description copied from interface: RMNode
the ContainerManager address for this node.

Specified by:
getNodeAddress in interface RMNode
Returns:
the ContainerManager address for this node.

getHttpAddress

public String getHttpAddress()
Description copied from interface: RMNode
the http-Address for this node.

Specified by:
getHttpAddress in interface RMNode
Returns:
the http-url address for this node

getTotalCapability

public org.apache.hadoop.yarn.api.records.Resource getTotalCapability()
Description copied from interface: RMNode
the total available resource.

Specified by:
getTotalCapability in interface RMNode
Returns:
the total available resource.

getRackName

public String getRackName()
Description copied from interface: RMNode
The rack name for this node manager.

Specified by:
getRackName in interface RMNode
Returns:
the rack name.

getNode

public org.apache.hadoop.net.Node getNode()
Description copied from interface: RMNode
the Node information for this node.

Specified by:
getNode in interface RMNode
Returns:
Node information for this node.

getHealthReport

public String getHealthReport()
Description copied from interface: RMNode
the latest health report received from this node.

Specified by:
getHealthReport in interface RMNode
Returns:
the latest health report received from this node.

setHealthReport

public void setHealthReport(String healthReport)

setLastHealthReportTime

public void setLastHealthReportTime(long lastHealthReportTime)

getLastHealthReportTime

public long getLastHealthReportTime()
Description copied from interface: RMNode
the time of the latest health report received from this node.

Specified by:
getLastHealthReportTime in interface RMNode
Returns:
the time of the latest health report received from this node.

getState

public org.apache.hadoop.yarn.api.records.NodeState getState()
Specified by:
getState in interface RMNode

getAppsToCleanup

public List<org.apache.hadoop.yarn.api.records.ApplicationId> getAppsToCleanup()
Specified by:
getAppsToCleanup in interface RMNode

getContainersToCleanUp

public List<org.apache.hadoop.yarn.api.records.ContainerId> getContainersToCleanUp()
Specified by:
getContainersToCleanUp in interface RMNode

updateNodeHeartbeatResponseForCleanup

public void updateNodeHeartbeatResponseForCleanup(org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse response)
Description copied from interface: RMNode
Update a NodeHeartbeatResponse with the list of containers and applications to clean up for this node.

Specified by:
updateNodeHeartbeatResponseForCleanup in interface RMNode
Parameters:
response - the NodeHeartbeatResponse to update

getLastNodeHeartBeatResponse

public org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse getLastNodeHeartBeatResponse()
Specified by:
getLastNodeHeartBeatResponse in interface RMNode

handle

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

pullContainerUpdates

public List<UpdatedContainerInfo> pullContainerUpdates()
Description copied from interface: RMNode
Get and clear the list of containerUpdates accumulated across NM heartbeats.

Specified by:
pullContainerUpdates in interface RMNode
Returns:
containerUpdates accumulated across NM heartbeats.

setNextHeartBeat

public void setNextHeartBeat(boolean nextHeartBeat)

getQueueSize

public int getQueueSize()


Copyright © 2014 Apache Software Foundation. All Rights Reserved.