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

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

@InterfaceAudience.Public
@InterfaceStability.Unstable
public abstract class ReservationRequest
extends Object
implements Comparable<ReservationRequest>

ReservationRequest represents the request made by an application to the ResourceManager to reserve Resources.

It includes:


Nested Class Summary
static class ReservationRequest.ReservationRequestComparator
           
 
Constructor Summary
ReservationRequest()
           
 
Method Summary
 int compareTo(ReservationRequest other)
           
 boolean equals(Object obj)
           
abstract  Resource getCapability()
          Get the Resource capability of the request.
abstract  int getConcurrency()
          Get the number of containers that need to be scheduled concurrently.
abstract  long getDuration()
          Get the duration in milliseconds for which the resource is required.
abstract  int getNumContainers()
          Get the number of containers required with the given specifications.
 int hashCode()
           
static ReservationRequest newInstance(Resource capability, int numContainers)
           
static ReservationRequest newInstance(Resource capability, int numContainers, int concurrency, long duration)
           
abstract  void setCapability(Resource capability)
          Set the Resource capability of the request
abstract  void setConcurrency(int numContainers)
          Set the number of containers that need to be scheduled concurrently.
abstract  void setDuration(long duration)
          Set the duration in milliseconds for which the resource is required.
abstract  void setNumContainers(int numContainers)
          Set the number of containers required with the given specifications
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReservationRequest

public ReservationRequest()
Method Detail

newInstance

@InterfaceAudience.Public
@InterfaceStability.Unstable
public static ReservationRequest newInstance(Resource capability,
                                                                                                  int numContainers)

newInstance

@InterfaceAudience.Public
@InterfaceStability.Unstable
public static ReservationRequest newInstance(Resource capability,
                                                                                                  int numContainers,
                                                                                                  int concurrency,
                                                                                                  long duration)

getCapability

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

Returns:
Resource capability of the request

setCapability

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

Parameters:
capability - Resource capability of the request

getNumContainers

@InterfaceAudience.Public
@InterfaceStability.Unstable
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.Unstable
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

getConcurrency

@InterfaceAudience.Public
@InterfaceStability.Unstable
public abstract int getConcurrency()
Get the number of containers that need to be scheduled concurrently. The default value of 1 would fall back to the current non concurrency constraints on the scheduling behavior.

Returns:
the number of containers to be concurrently scheduled

setConcurrency

@InterfaceAudience.Public
@InterfaceStability.Unstable
public abstract void setConcurrency(int numContainers)
Set the number of containers that need to be scheduled concurrently. The default value of 1 would fall back to the current non concurrency constraints on the scheduling behavior.

Parameters:
numContainers - the number of containers to be concurrently scheduled

getDuration

@InterfaceAudience.Public
@InterfaceStability.Unstable
public abstract long getDuration()
Get the duration in milliseconds for which the resource is required. A default value of -1, indicates an unspecified lease duration, and fallback to current behavior.

Returns:
the duration in milliseconds for which the resource is required

setDuration

@InterfaceAudience.Public
@InterfaceStability.Unstable
public abstract void setDuration(long duration)
Set the duration in milliseconds for which the resource is required.

Parameters:
duration - the duration in milliseconds for which the resource is required

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

compareTo

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


Copyright © 2014 Apache Software Foundation. All Rights Reserved.