@InterfaceAudience.Private @InterfaceStability.Unstable public class ResourceRequestPBImpl extends ResourceRequest
ResourceRequest.ResourceRequestComparator
ANY
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, newInstance
public ResourceRequestPBImpl()
public ResourceRequestPBImpl(YarnProtos.ResourceRequestProto proto)
public YarnProtos.ResourceRequestProto getProto()
public Priority getPriority()
ResourceRequest
Priority
of the request.getPriority
in class ResourceRequest
Priority
of the requestpublic void setPriority(Priority priority)
ResourceRequest
Priority
of the requestsetPriority
in class ResourceRequest
priority
- Priority
of the requestpublic String getResourceName()
ResourceRequest
getResourceName
in class ResourceRequest
public void setResourceName(String resourceName)
ResourceRequest
setResourceName
in class ResourceRequest
resourceName
- (e.g. host/rack) on which the
allocation is desiredpublic Resource getCapability()
ResourceRequest
Resource
capability of the request.getCapability
in class ResourceRequest
Resource
capability of the requestpublic void setCapability(Resource capability)
ResourceRequest
Resource
capability of the requestsetCapability
in class ResourceRequest
capability
- Resource
capability of the requestpublic int getNumContainers()
ResourceRequest
getNumContainers
in class ResourceRequest
public void setNumContainers(int numContainers)
ResourceRequest
setNumContainers
in class ResourceRequest
numContainers
- number of containers required with the given
specificationspublic boolean getRelaxLocality()
ResourceRequest
ResourceRequest
. Defaults to true.getRelaxLocality
in class ResourceRequest
ResourceRequest
.public void setRelaxLocality(boolean relaxLocality)
ResourceRequest
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 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 ResourceRequest
relaxLocality
- whether locality relaxation is enabled with this
ResourceRequest
.Copyright © 2013 Apache Software Foundation. All rights reserved.