Class ReservationRequest
java.lang.Object
org.apache.hadoop.yarn.api.records.ReservationRequest
- All Implemented Interfaces:
Comparable<ReservationRequest>
@Public
@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:
Resourcerequired for each request.- Number of containers, of above specifications, which are required by the application.
- Concurrency that indicates the gang size of the request.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ReservationRequest other) booleanabstract ResourceGet theResourcecapability of the request.abstract intGet the number of containers that need to be scheduled concurrently.abstract longGet the duration in milliseconds for which the resource is required.abstract intGet the number of containers required with the given specifications.inthashCode()static ReservationRequestnewInstance(Resource capability, int numContainers) static ReservationRequestnewInstance(Resource capability, int numContainers, int concurrency, long duration) abstract voidsetCapability(Resource capability) Set theResourcecapability of the requestabstract voidsetConcurrency(int numContainers) Set the number of containers that need to be scheduled concurrently.abstract voidsetDuration(long duration) Set the duration in milliseconds for which the resource is required.abstract voidsetNumContainers(int numContainers) Set the number of containers required with the given specifications
-
Constructor Details
-
ReservationRequest
public ReservationRequest()
-
-
Method Details
-
newInstance
@Public @Unstable public static ReservationRequest newInstance(Resource capability, int numContainers) -
newInstance
@Public @Unstable public static ReservationRequest newInstance(Resource capability, int numContainers, int concurrency, long duration) -
getCapability
Get theResourcecapability of the request.- Returns:
Resourcecapability of the request
-
setCapability
Set theResourcecapability of the request- Parameters:
capability-Resourcecapability of the request
-
getNumContainers
@Public @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
@Public @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
@Public @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
@Public @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
@Public @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
@Public @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() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<ReservationRequest>
-