|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.yarn.api.records.ResourceRequest
@InterfaceAudience.Public @InterfaceStability.Stable public abstract class ResourceRequest
ResourceRequest
represents the request made by an
application to the ResourceManager
to obtain various
Container
allocations.
It includes:
Priority
of the request.Resource
required for each request.true
,
which tells the ResourceManager
if the application wants
locality to be loose (i.e. allows fall-through to rack or any)
or strict (i.e. specify hard constraint on resource allocation).
Resource
,
ApplicationMasterProtocol.allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest)
Nested Class Summary | |
---|---|
static class |
ResourceRequest.ResourceRequestComparator
|
Field Summary | |
---|---|
static String |
ANY
The constant string representing no locality. |
Constructor Summary | |
---|---|
ResourceRequest()
|
Method Summary | |
---|---|
int |
compareTo(ResourceRequest other)
|
boolean |
equals(Object obj)
|
abstract Resource |
getCapability()
Get the Resource capability of the request. |
abstract int |
getNumContainers()
Get the number of containers required with the given specifications. |
abstract Priority |
getPriority()
Get the Priority of the request. |
abstract boolean |
getRelaxLocality()
Get whether locality relaxation is enabled with this ResourceRequest . |
abstract String |
getResourceName()
Get the resource (e.g. |
int |
hashCode()
|
static boolean |
isAnyLocation(String hostName)
Check whether the given host/rack string represents an arbitrary host name. |
static ResourceRequest |
newInstance(Priority priority,
String hostName,
Resource capability,
int numContainers)
|
static ResourceRequest |
newInstance(Priority priority,
String hostName,
Resource capability,
int numContainers,
boolean relaxLocality)
|
abstract void |
setCapability(Resource capability)
Set the Resource capability of the request |
abstract void |
setNumContainers(int numContainers)
Set the number of containers required with the given specifications |
abstract void |
setPriority(Priority priority)
Set the Priority of the request |
abstract void |
setRelaxLocality(boolean relaxLocality)
For a request at a network hierarchy level, set whether locality can be relaxed to that level and beyond. |
abstract void |
setResourceName(String resourceName)
Set the resource name (e.g. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ANY
Constructor Detail |
---|
public ResourceRequest()
Method Detail |
---|
@InterfaceAudience.Public @InterfaceStability.Stable public static ResourceRequest newInstance(Priority priority, String hostName, Resource capability, int numContainers)
@InterfaceAudience.Public @InterfaceStability.Stable public static ResourceRequest newInstance(Priority priority, String hostName, Resource capability, int numContainers, boolean relaxLocality)
@InterfaceAudience.Public @InterfaceStability.Stable public static boolean isAnyLocation(String hostName)
hostName
- host/rack on which the allocation is desired
@InterfaceAudience.Public @InterfaceStability.Stable public abstract Priority getPriority()
Priority
of the request.
Priority
of the request@InterfaceAudience.Public @InterfaceStability.Stable public abstract void setPriority(Priority priority)
Priority
of the request
priority
- Priority
of the request@InterfaceAudience.Public @InterfaceStability.Stable public abstract String getResourceName()
@InterfaceAudience.Public @InterfaceStability.Stable public abstract void setResourceName(String resourceName)
resourceName
- (e.g. host/rack) on which the
allocation is desired@InterfaceAudience.Public @InterfaceStability.Stable public abstract Resource getCapability()
Resource
capability of the request.
Resource
capability of the request@InterfaceAudience.Public @InterfaceStability.Stable public abstract void setCapability(Resource capability)
Resource
capability of the request
capability
- Resource
capability of the request@InterfaceAudience.Public @InterfaceStability.Stable public abstract int getNumContainers()
@InterfaceAudience.Public @InterfaceStability.Stable public abstract void setNumContainers(int numContainers)
numContainers
- number of containers required with the given
specifications@InterfaceAudience.Public @InterfaceStability.Stable public abstract boolean getRelaxLocality()
ResourceRequest
. Defaults to true.
ResourceRequest
.@InterfaceAudience.Public @InterfaceStability.Stable public abstract void setRelaxLocality(boolean relaxLocality)
For a request at a network hierarchy level, set whether locality can be relaxed to that level and beyond.
If the flag is off on a rack-level ResourceRequest
,
containers at that request's priority will not be assigned to nodes on that
request's rack unless requests specifically for those nodes have also been
submitted.
If the flag is off on an ANY
-level
ResourceRequest
, containers at that request's priority will
only be assigned on racks for which specific requests have also been
submitted.
For example, to request a container strictly on a specific node, the corresponding rack-level and any-level requests should have locality relaxation set to false. Similarly, to request a container strictly on a specific rack, the corresponding any-level request should have locality relaxation set to false.
relaxLocality
- whether locality relaxation is enabled with this
ResourceRequest
.public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public int compareTo(ResourceRequest other)
compareTo
in interface Comparable<ResourceRequest>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |