org.apache.hadoop.yarn.client.api
Class AMRMClient.ContainerRequest

java.lang.Object
  extended by org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest
Enclosing class:
AMRMClient<T extends AMRMClient.ContainerRequest>

public static class AMRMClient.ContainerRequest
extends Object

Object to represent a single container request for resources. Scheduler documentation should be consulted for the specifics of how the parameters are honored. By default, YARN schedulers try to allocate containers at the requested locations but they may relax the constraints in order to expedite meeting allocations limits. They first relax the constraint to the same rack as the requested node and then to anywhere in the cluster. The relaxLocality flag may be used to disable locality relaxation and request containers at only specific locations. The following conditions apply.

To re-enable locality relaxation at a given priority, all pending requests with locality relaxation disabled must be first removed. Then they can be added back with locality relaxation enabled. All getters return immutable values.


Constructor Summary
AMRMClient.ContainerRequest(org.apache.hadoop.yarn.api.records.Resource capability, String[] nodes, String[] racks, org.apache.hadoop.yarn.api.records.Priority priority)
          Instantiates a AMRMClient.ContainerRequest with the given constraints and locality relaxation enabled.
AMRMClient.ContainerRequest(org.apache.hadoop.yarn.api.records.Resource capability, String[] nodes, String[] racks, org.apache.hadoop.yarn.api.records.Priority priority, boolean relaxLocality)
          Instantiates a AMRMClient.ContainerRequest with the given constraints.
 
Method Summary
 org.apache.hadoop.yarn.api.records.Resource getCapability()
           
 List<String> getNodes()
           
 org.apache.hadoop.yarn.api.records.Priority getPriority()
           
 List<String> getRacks()
           
 boolean getRelaxLocality()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AMRMClient.ContainerRequest

public AMRMClient.ContainerRequest(org.apache.hadoop.yarn.api.records.Resource capability,
                                   String[] nodes,
                                   String[] racks,
                                   org.apache.hadoop.yarn.api.records.Priority priority)
Instantiates a AMRMClient.ContainerRequest with the given constraints and locality relaxation enabled.

Parameters:
capability - The Resource to be requested for each container.
nodes - Any hosts to request that the containers are placed on.
racks - Any racks to request that the containers are placed on. The racks corresponding to any hosts requested will be automatically added to this list.
priority - The priority at which to request the containers. Higher priorities have lower numerical values.

AMRMClient.ContainerRequest

public AMRMClient.ContainerRequest(org.apache.hadoop.yarn.api.records.Resource capability,
                                   String[] nodes,
                                   String[] racks,
                                   org.apache.hadoop.yarn.api.records.Priority priority,
                                   boolean relaxLocality)
Instantiates a AMRMClient.ContainerRequest with the given constraints.

Parameters:
capability - The Resource to be requested for each container.
nodes - Any hosts to request that the containers are placed on.
racks - Any racks to request that the containers are placed on. The racks corresponding to any hosts requested will be automatically added to this list.
priority - The priority at which to request the containers. Higher priorities have lower numerical values.
relaxLocality - If true, containers for this request may be assigned on hosts and racks other than the ones explicitly requested.
Method Detail

getCapability

public org.apache.hadoop.yarn.api.records.Resource getCapability()

getNodes

public List<String> getNodes()

getRacks

public List<String> getRacks()

getPriority

public org.apache.hadoop.yarn.api.records.Priority getPriority()

getRelaxLocality

public boolean getRelaxLocality()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 Apache Software Foundation. All Rights Reserved.