@InterfaceAudience.Private @InterfaceStability.Unstable public abstract class SchedulerNode extends Object
Constructor and Description |
---|
SchedulerNode(RMNode node,
boolean usePortForNodeName) |
SchedulerNode(RMNode node,
boolean usePortForNodeName,
Set<String> labels) |
Modifier and Type | Method and Description |
---|---|
void |
allocateContainer(RMContainer rmContainer)
The Scheduler has allocated containers on this node to the given
application.
|
org.apache.hadoop.yarn.api.records.Resource |
getAvailableResource()
Get available resources on the node.
|
String |
getHttpAddress() |
Set<String> |
getLabels() |
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) |
void |
setTotalResource(org.apache.hadoop.yarn.api.records.Resource resource)
Set total resources on the node.
|
String |
toString() |
abstract void |
unreserveResource(SchedulerApplicationAttempt attempt)
Unreserve resources on this node.
|
void |
updateLabels(Set<String> labels) |
public SchedulerNode(RMNode node, boolean usePortForNodeName)
public RMNode getRMNode()
public void setTotalResource(org.apache.hadoop.yarn.api.records.Resource resource)
resource
- total resources on the node.public org.apache.hadoop.yarn.api.records.NodeId getNodeID()
public String getHttpAddress()
public String getNodeName()
Typically this is the 'hostname' reported by the node, but it could be
configured to be 'hostname:port' reported by the node via the
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 recoverContainer(RMContainer rmContainer)
Copyright © 2015 Apache Software Foundation. All Rights Reserved.