ResourceAllocationRequest (Apache Hadoop YARN API 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.api.records, class: ResourceAllocationRequest

Package org.apache.hadoop.yarn.api.records

# Class ResourceAllocationRequest

java.lang.Object
org.apache.hadoop.yarn.api.records.ResourceAllocationRequest

@Public @Stable public abstract class ResourceAllocationRequest extends Object
`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.
- `Resource` reserved for the allocation.

See Also:
  - `Resource`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ResourceAllocationRequest()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract Resource`
  `getCapability()`
  Get the allocated resource.
  `abstract long`
  `getEndTime()`
  Get the end time that the resource is allocated.
  `abstract long`
  `getStartTime()`
  Get the start time that the resource is allocated.
  `static ResourceAllocationRequest`
  `newInstance(long startTime, long endTime, Resource capability)`
  `abstract void`
  `setCapability(Resource resource)`
  Set the allocated resource.
  `abstract void`
  `setEndTime(long endTime)`
  Set the end time that the resource is allocated.
  `abstract void`
  `setStartTime(long startTime)`
  Set the start time that the resource is allocated.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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` - `Resource` representing 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

    @Public @Unstable public abstract Resource getCapability()
    Get the allocated resource.
    Returns:
      the allocated resource.

  - ### setCapability

    @Private @Unstable public abstract void setCapability(Resource resource)
    Set the allocated resource.
    Parameters:
      `resource` - `Resource` representing the capability of the resource allocation.