org.apache.hadoop.yarn.api.records
Class ResourceRequest

java.lang.Object
  extended by org.apache.hadoop.yarn.api.records.ResourceRequest
All Implemented Interfaces:
Comparable<ResourceRequest>

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class ResourceRequest
extends Object
implements Comparable<ResourceRequest>

ResourceRequest represents the request made by an application to the ResourceManager to obtain various Container allocations.

It includes:

See Also:
Resource, AMRMProtocol.allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest)

Constructor Summary
ResourceRequest()
           
 
Method Summary
 int compareTo(ResourceRequest other)
           
 boolean equals(Object obj)
           
abstract  Resource getCapability()
          Get the Resource capability of the request.
abstract  String getHostName()
          Get the host/rack on which the allocation is desired.
abstract  int getNumContainers()
          Get the number of containers required with the given specifications.
abstract  org.apache.hadoop.yarn.api.records.Priority getPriority()
          Get the Priority of the request.
 int hashCode()
           
abstract  void setCapability(Resource capability)
          Set the Resource capability of the request
abstract  void setHostName(String hostName)
          Set host/rack on which the allocation is desired.
abstract  void setNumContainers(int numContainers)
          Set the number of containers required with the given specifications
abstract  void setPriority(org.apache.hadoop.yarn.api.records.Priority priority)
          Set the Priority of the request
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceRequest

public ResourceRequest()
Method Detail

getPriority

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract org.apache.hadoop.yarn.api.records.Priority getPriority()
Get the Priority of the request.

Returns:
Priority of the request

setPriority

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setPriority(org.apache.hadoop.yarn.api.records.Priority priority)
Set the Priority of the request

Parameters:
priority - Priority of the request

getHostName

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract String getHostName()
Get the host/rack on which the allocation is desired. A special value of * signifies that any host/rack is acceptable.

Returns:
host/rack on which the allocation is desired

setHostName

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setHostName(String hostName)
Set host/rack on which the allocation is desired. A special value of * signifies that any host/rack is acceptable.

Parameters:
hostName - host/rack on which the allocation is desired

getCapability

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract Resource getCapability()
Get the Resource capability of the request.

Returns:
Resource capability of the request

setCapability

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setCapability(Resource capability)
Set the Resource capability of the request

Parameters:
capability - Resource capability of the request

getNumContainers

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract int getNumContainers()
Get the number of containers required with the given specifications.

Returns:
number of containers required with the given specifications

setNumContainers

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setNumContainers(int numContainers)
Set the number of containers required with the given specifications

Parameters:
numContainers - number of containers required with the given specifications

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

compareTo

public int compareTo(ResourceRequest other)
Specified by:
compareTo in interface Comparable<ResourceRequest>


Copyright © 2013 Apache Software Foundation. All Rights Reserved.