Class ResourceRequestSet
java.lang.Object
org.apache.hadoop.yarn.server.scheduler.ResourceRequestSet
A set of resource requests of the same scheduler key
ResourceRequestSetKey.-
Constructor Summary
ConstructorsConstructorDescriptionCreate a shallow copy of the request set.Create a empty set with given key. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAndOverrideRR(org.apache.hadoop.yarn.api.records.ResourceRequest ask) Add aResourceRequestinto the requestSet.voidaddAndOverrideRRSet(ResourceRequestSet requestSet) Merge a requestSet into this one.voidRemove all non-Any ResourceRequests from the set.getAsks()intCollection<org.apache.hadoop.yarn.api.records.ResourceRequest>getRRs()booleanWhether the request set is relaxable at ANY level.voidsetNumContainers(int newValue) Force set the # of containers to ask for this requestSet to a given value.toString()
-
Constructor Details
-
ResourceRequestSet
public ResourceRequestSet(ResourceRequestSetKey key) throws org.apache.hadoop.yarn.exceptions.YarnException Create a empty set with given key.- Parameters:
key- the key of the request set- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if fails
-
ResourceRequestSet
Create a shallow copy of the request set.- Parameters:
other- the set of copy from
-
-
Method Details
-
addAndOverrideRR
public void addAndOverrideRR(org.apache.hadoop.yarn.api.records.ResourceRequest ask) throws org.apache.hadoop.yarn.exceptions.YarnException Add aResourceRequestinto the requestSet. If there's already an RR with the same resource name, override it and update accordingly.- Parameters:
ask- the newResourceRequest- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- indicates exceptions from yarn servers.
-
addAndOverrideRRSet
public void addAndOverrideRRSet(ResourceRequestSet requestSet) throws org.apache.hadoop.yarn.exceptions.YarnException Merge a requestSet into this one.- Parameters:
requestSet- the requestSet to merge- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- indicates exceptions from yarn servers.
-
cleanupZeroNonAnyRR
public void cleanupZeroNonAnyRR()Remove all non-Any ResourceRequests from the set. This is necessary cleanup to avoid requestSet getting too big. -
getAsks
-
getRRs
-
getNumContainers
public int getNumContainers() -
setNumContainers
public void setNumContainers(int newValue) throws org.apache.hadoop.yarn.exceptions.YarnException Force set the # of containers to ask for this requestSet to a given value.- Parameters:
newValue- the new # of containers value- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- indicates exceptions from yarn servers.
-
isANYRelaxable
public boolean isANYRelaxable()Whether the request set is relaxable at ANY level.- Returns:
- whether the request set is relaxable at ANY level
-
toString
-