org.apache.hadoop.yarn.api.records

## Class ResourceAllocationRequest

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

-     @InterfaceAudience.Public
       @InterfaceStability.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 and Description
    `ResourceAllocationRequest()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### ResourceAllocationRequest

          public ResourceAllocationRequest()

  - ### Method Detail

    - #### newInstance

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

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract long getStartTime()

      Get the start time that the resource is allocated.
      Returns:
        the start time that the resource is allocated.

    - #### setStartTime

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

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract long getEndTime()

      Get the end time that the resource is allocated.
      Returns:
        the end time that the resource is allocated.

    - #### setEndTime

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

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Resource getCapability()

      Get the allocated resource.
      Returns:
        the allocated resource.

    - #### setCapability

          @InterfaceAudience.Private
           @InterfaceStability.Unstable
          public abstract void setCapability(Resource resource)

      Set the allocated resource.
      Parameters:
        `resource` - `Resource` representing the capability of the resource allocation.

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.