org.apache.hadoop.yarn.api.records

## Class ReservationDefinition

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

-     @InterfaceAudience.Public
       @InterfaceStability.Unstable
      public abstract class ReservationDefinition
      extends Object

  `ReservationDefinition` captures the set of resource and time constraints the user cares about regarding a reservation.
  See Also:
    `ResourceRequest`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReservationDefinition()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract long` | `getArrival()` Get the arrival time or the earliest time from which the resource(s) can be allocated.
    `abstract long` | `getDeadline()` Get the deadline or the latest time by when the resource(s) must be allocated.
    `abstract Priority` | `getPriority()` Get the priority for this reservation.
    `abstract String` | `getRecurrenceExpression()` Get the recurrence of this reservation representing the time period of the periodic job.
    `abstract String` | `getReservationName()` Get the name for this reservation.
    `abstract ReservationRequests` | `getReservationRequests()` Get the list of `ReservationRequests` representing the resources required by the application
    `static ReservationDefinition` | `newInstance(long arrival, long deadline, ReservationRequests reservationRequests, String name)`
    `static ReservationDefinition` | `newInstance(long arrival, long deadline, ReservationRequests reservationRequests, String name, String recurrenceExpression, Priority priority)`
    `abstract void` | `setArrival(long earliestStartTime)` Set the arrival time or the earliest time from which the resource(s) can be allocated.
    `abstract void` | `setDeadline(long latestEndTime)` Set the deadline or the latest time by when the resource(s) must be allocated.
    `abstract void` | `setPriority(Priority priority)` Set the priority for this reservation.
    `abstract void` | `setRecurrenceExpression(String recurrenceExpression)` Set the recurrence of this reservation representing the time period of the periodic job.
    `abstract void` | `setReservationName(String name)` Set the name for this reservation.
    `abstract void` | `setReservationRequests(ReservationRequests reservationRequests)` Set the list of `ReservationRequests` representing the resources required by the application

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

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

- - ### Constructor Detail

    - #### ReservationDefinition

          public ReservationDefinition()

  - ### Method Detail

    - #### newInstance

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public static ReservationDefinition newInstance(long arrival,
                                                                                                                  long deadline,
                                                                                                                  ReservationRequests reservationRequests,
                                                                                                                  String name,
                                                                                                                  String recurrenceExpression,
                                                                                                                  Priority priority)

    - #### newInstance

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public static ReservationDefinition newInstance(long arrival,
                                                                                                                  long deadline,
                                                                                                                  ReservationRequests reservationRequests,
                                                                                                                  String name)

    - #### getArrival

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

      Get the arrival time or the earliest time from which the resource(s) can be allocated. Time expressed as UTC.
      Returns:
        the earliest valid time for this reservation

    - #### setArrival

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract void setArrival(long earliestStartTime)

      Set the arrival time or the earliest time from which the resource(s) can be allocated. Time expressed as UTC.
      Parameters:
        `earliestStartTime` - the earliest valid time for this reservation

    - #### getDeadline

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

      Get the deadline or the latest time by when the resource(s) must be allocated. Time expressed as UTC.
      Returns:
        the deadline or the latest time by when the resource(s) must be allocated

    - #### setDeadline

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract void setDeadline(long latestEndTime)

      Set the deadline or the latest time by when the resource(s) must be allocated. Time expressed as UTC.
      Parameters:
        `latestEndTime` - the deadline or the latest time by when the resource(s) should be allocated

    - #### getReservationRequests

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract ReservationRequests getReservationRequests()

      Get the list of `ReservationRequests` representing the resources required by the application
      Returns:
        the list of `ReservationRequests`

    - #### setReservationRequests

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract void setReservationRequests(ReservationRequests reservationRequests)

      Set the list of `ReservationRequests` representing the resources required by the application
      Parameters:
        `reservationRequests` - the list of `ReservationRequests`

    - #### getReservationName

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract String getReservationName()

      Get the name for this reservation. The name need-not be unique, and it is just a mnemonic for the user (akin to job names). Accepted reservations are uniquely identified by a system-generated ReservationId.
      Returns:
        string representing the name of the corresponding reserved resource allocation in the scheduler

    - #### setReservationName

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract void setReservationName(String name)

      Set the name for this reservation. The name need-not be unique, and it is just a mnemonic for the user (akin to job names). Accepted reservations are uniquely identified by a system-generated ReservationId.
      Parameters:
        `name` - representing the name of the corresponding reserved resource allocation in the scheduler

    - #### getRecurrenceExpression

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract String getRecurrenceExpression()

      Get the recurrence of this reservation representing the time period of the periodic job. Currently, only long values are supported. Later, support for regular expressions denoting arbitrary recurrence patterns (e.g., every Tuesday and Thursday) will be added. Recurrence is represented in milliseconds for periodic jobs. Recurrence is 0 for non-periodic jobs. Periodic jobs are valid until they are explicitly cancelled and have higher priority than non-periodic jobs (during initial placement and replanning). Periodic job allocations are consistent across runs (flexibility in allocation is leveraged only during initial placement, allocations remain consistent thereafter). Note that as a long, the recurrence expression must be greater than the duration of the reservation (deadline - arrival). Also note that the configured max period must be divisible by the recurrence expression if expressed as a long.
      Returns:
        recurrence of this reservation

    - #### setRecurrenceExpression

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract void setRecurrenceExpression(String recurrenceExpression)

      Set the recurrence of this reservation representing the time period of the periodic job. Currently, only long values are supported. Later, support for regular expressions denoting arbitrary recurrence patterns (e.g., every Tuesday and Thursday) will be added. Recurrence is represented in milliseconds for periodic jobs. Recurrence is 0 for non-periodic jobs. Periodic jobs are valid until they are explicitly cancelled and have higher priority than non-periodic jobs (during initial placement and replanning). Periodic job allocations are consistent across runs (flexibility in allocation is leveraged only during initial placement, allocations remain consistent thereafter). Note that as a long, the recurrence expression must be greater than the duration of the reservation (deadline - arrival). Also note that the configured max period must be divisible by the recurrence expression if expressed as a long.
      Parameters:
        `recurrenceExpression` - recurrence interval of this reservation

    - #### getPriority

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Priority getPriority()

      Get the priority for this reservation. A lower number for priority indicates a higher priority reservation. Recurring reservations are always higher priority than non-recurring reservations. Priority for non-recurring reservations are only compared with non-recurring reservations. Likewise for recurring reservations.
      Returns:
        int representing the priority of the reserved resource allocation in the scheduler

    - #### setPriority

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract void setPriority(Priority priority)

      Set the priority for this reservation. A lower number for priority indicates a higher priority reservation. Recurring reservations are always higher priority than non-recurring reservations. Priority for non-recurring reservations are only compared with non-recurring reservations. Likewise for recurring reservations.
      Parameters:
        `priority` - representing the priority of the reserved resource allocation in the scheduler

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