Class ResourceAllocationRequest
java.lang.Object
org.apache.hadoop.yarn.api.records.ResourceAllocationRequest
ResourceAllocationRequest represents an allocation
made for a reservation for the current state of the plan. This can be
changed for reasons such as re-planning, but will always be subject to the
constraints of the user contract as described by
ReservationDefinition
Resource
It includes:
- StartTime of the allocation.
- EndTime of the allocation.
Resourcereserved for the allocation.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ResourceGet the allocated resource.abstract longGet the end time that the resource is allocated.abstract longGet the start time that the resource is allocated.static ResourceAllocationRequestnewInstance(long startTime, long endTime, Resource capability) abstract voidsetCapability(Resource resource) Set the allocated resource.abstract voidsetEndTime(long endTime) Set the end time that the resource is allocated.abstract voidsetStartTime(long startTime) Set the start time that the resource is allocated.
-
Constructor Details
-
ResourceAllocationRequest
public ResourceAllocationRequest()
-
-
Method Details
-
newInstance
@Public @Stable public static ResourceAllocationRequest newInstance(long startTime, long endTime, Resource capability) - Parameters:
startTime- The start time that the capability is reserved for.endTime- The end time that the capability is reserved for.capability-Resourcerepresenting the capability of the resource allocation.- Returns:
- {ResourceAllocationRequest} which represents the capability of the resource allocation for a time interval.
-
getStartTime
@Public @Unstable public abstract long getStartTime()Get the start time that the resource is allocated.- Returns:
- the start time that the resource is allocated.
-
setStartTime
@Private @Unstable public abstract void setStartTime(long startTime) Set the start time that the resource is allocated.- Parameters:
startTime- The start time that the capability is reserved for.
-
getEndTime
@Public @Unstable public abstract long getEndTime()Get the end time that the resource is allocated.- Returns:
- the end time that the resource is allocated.
-
setEndTime
@Private @Unstable public abstract void setEndTime(long endTime) Set the end time that the resource is allocated.- Parameters:
endTime- The end time that the capability is reserved for.
-
getCapability
Get the allocated resource.- Returns:
- the allocated resource.
-
setCapability
Set the allocated resource.- Parameters:
resource-Resourcerepresenting the capability of the resource allocation.
-