@InterfaceAudience.Private @InterfaceStability.Unstable public abstract class SchedulerNode extends Object
| Constructor and Description |
|---|
SchedulerNode(RMNode node,
boolean usePortForNodeName) |
| Modifier and Type | Method and Description |
|---|---|
void |
allocateContainer(RMContainer rmContainer)
The Scheduler has allocated containers on this node to the given
application.
|
void |
applyDeltaOnAvailableResource(org.apache.hadoop.yarn.api.records.Resource deltaResource)
Apply delta resource on node's available resource.
|
org.apache.hadoop.yarn.api.records.Resource |
getAvailableResource()
Get available resources on the node.
|
String |
getHttpAddress() |
org.apache.hadoop.yarn.api.records.NodeId |
getNodeID()
Get the ID of the node which contains both its hostname and port.
|
String |
getNodeName()
Get the name of the node for scheduling matching decisions.
|
int |
getNumContainers()
Get number of active containers on the node.
|
String |
getRackName()
Get rackname.
|
RMContainer |
getReservedContainer() |
RMNode |
getRMNode() |
List<RMContainer> |
getRunningContainers() |
org.apache.hadoop.yarn.api.records.Resource |
getTotalResource()
Get total resources on the node.
|
org.apache.hadoop.yarn.api.records.Resource |
getUsedResource()
Get used resources on the node.
|
boolean |
isValidContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) |
void |
recoverContainer(RMContainer rmContainer) |
void |
releaseContainer(org.apache.hadoop.yarn.api.records.Container container)
Release an allocated container on this node.
|
abstract void |
reserveResource(SchedulerApplicationAttempt attempt,
org.apache.hadoop.yarn.api.records.Priority priority,
RMContainer container)
Reserve container for the attempt on this node.
|
protected void |
setReservedContainer(RMContainer reservedContainer) |
String |
toString() |
abstract void |
unreserveResource(SchedulerApplicationAttempt attempt)
Unreserve resources on this node.
|
public SchedulerNode(RMNode node, boolean usePortForNodeName)
public RMNode getRMNode()
public org.apache.hadoop.yarn.api.records.NodeId getNodeID()
public String getHttpAddress()
public String getNodeName()
YarnConfiguration.RM_SCHEDULER_INCLUDE_PORT_IN_NODE_NAME constant.
The main usecase of this is Yarn minicluster to be able to differentiate
node manager instances by their port number.public String getRackName()
public void allocateContainer(RMContainer rmContainer)
rmContainer - allocated containerpublic org.apache.hadoop.yarn.api.records.Resource getAvailableResource()
public org.apache.hadoop.yarn.api.records.Resource getUsedResource()
public org.apache.hadoop.yarn.api.records.Resource getTotalResource()
public boolean isValidContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
public void releaseContainer(org.apache.hadoop.yarn.api.records.Container container)
container - container to be releasedpublic abstract void reserveResource(SchedulerApplicationAttempt attempt, org.apache.hadoop.yarn.api.records.Priority priority, RMContainer container)
public abstract void unreserveResource(SchedulerApplicationAttempt attempt)
public int getNumContainers()
public List<RMContainer> getRunningContainers()
public RMContainer getReservedContainer()
protected void setReservedContainer(RMContainer reservedContainer)
public void applyDeltaOnAvailableResource(org.apache.hadoop.yarn.api.records.Resource deltaResource)
deltaResource - the delta of resource need to apply to nodepublic void recoverContainer(RMContainer rmContainer)
Copyright © 2014 Apache Software Foundation. All Rights Reserved.