@InterfaceAudience.Private @InterfaceStability.Unstable public class ResourceRequestPBImpl extends ResourceRequest
ResourceRequest.ResourceRequestComparatorANY| Constructor and Description |
|---|
ResourceRequestPBImpl() |
ResourceRequestPBImpl(YarnProtos.ResourceRequestProto proto) |
| Modifier and Type | Method and Description |
|---|---|
Resource |
getCapability()
Get the
Resource capability of the request. |
int |
getNumContainers()
Get the number of containers required with the given specifications.
|
Priority |
getPriority()
Get the
Priority of the request. |
YarnProtos.ResourceRequestProto |
getProto() |
boolean |
getRelaxLocality()
Get whether locality relaxation is enabled with this
ResourceRequest. |
String |
getResourceName()
Get the resource (e.g.
|
void |
setCapability(Resource capability)
Set the
Resource capability of the request |
void |
setNumContainers(int numContainers)
Set the number of containers required with the given specifications
|
void |
setPriority(Priority priority)
Set the
Priority of the request |
void |
setRelaxLocality(boolean relaxLocality)
For a request at a network hierarchy level, set whether locality can be relaxed
to that level and beyond.
|
void |
setResourceName(String resourceName)
Set the resource name (e.g.
|
String |
toString() |
compareTo, equals, hashCode, isAnyLocation, newInstance, newInstancepublic ResourceRequestPBImpl()
public ResourceRequestPBImpl(YarnProtos.ResourceRequestProto proto)
public YarnProtos.ResourceRequestProto getProto()
public Priority getPriority()
ResourceRequestPriority of the request.getPriority in class ResourceRequestPriority of the requestpublic void setPriority(Priority priority)
ResourceRequestPriority of the requestsetPriority in class ResourceRequestpriority - Priority of the requestpublic String getResourceName()
ResourceRequestgetResourceName in class ResourceRequestpublic void setResourceName(String resourceName)
ResourceRequestsetResourceName in class ResourceRequestresourceName - (e.g. host/rack) on which the
allocation is desiredpublic Resource getCapability()
ResourceRequestResource capability of the request.getCapability in class ResourceRequestResource capability of the requestpublic void setCapability(Resource capability)
ResourceRequestResource capability of the requestsetCapability in class ResourceRequestcapability - Resource capability of the requestpublic int getNumContainers()
ResourceRequestgetNumContainers in class ResourceRequestpublic void setNumContainers(int numContainers)
ResourceRequestsetNumContainers in class ResourceRequestnumContainers - number of containers required with the given
specificationspublic boolean getRelaxLocality()
ResourceRequestResourceRequest. Defaults to true.getRelaxLocality in class ResourceRequestResourceRequest.public void setRelaxLocality(boolean relaxLocality)
ResourceRequestFor 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 ResourceRequest.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.
setRelaxLocality in class ResourceRequestrelaxLocality - whether locality relaxation is enabled with this
ResourceRequest.Copyright © 2013 Apache Software Foundation. All rights reserved.