Record Class SchedulerEngine.Job

java.lang.Object
java.lang.Record
org.elasticsearch.common.scheduler.SchedulerEngine.Job
Record Components:
id - the id of the job
schedule - the schedule which is used to calculate when the job runs
fixedStartTime - a fixed time in the past which the schedule uses to calculate run times,
Enclosing class:
SchedulerEngine

public static record SchedulerEngine.Job(String id, SchedulerEngine.Schedule schedule, Long fixedStartTime) extends Record
In most cases a Job only requires a `schedule` and an `id`, but an optional `fixedStartTime` can also be used. This is used as a fixed `startTime` argument for all calls to `schedule.nextScheduledTimeAfter(startTime, now)`. Interval-based schedules use `startTime` as a basis time from which all run times are calculated. If a Job does not contain a `fixedStartTime`, this basis time will be the time at which the Job is added to the SchedulerEngine. This could change if a master change or restart causes a new SchedulerEngine to be constructed. But using a `fixedStartTime` populated from a time stored in cluster state allows the basis time to remain unchanged across master changes and restarts.
  • Constructor Details

  • Method Details

    • getId

      public String getId()
      The following getters are redundant with the getters built in by the record. Unfortunately, getFieldName form getters are expected by serverless. These getters are being added back until serverless can be updated for the new getters.
    • getSchedule

      public SchedulerEngine.Schedule getSchedule()
    • getFixedStartTime

      public Long getFixedStartTime()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • schedule

      public SchedulerEngine.Schedule schedule()
      Returns the value of the schedule record component.
      Returns:
      the value of the schedule record component
    • fixedStartTime

      @Nullable public Long fixedStartTime()
      Returns the value of the fixedStartTime record component.
      Returns:
      the value of the fixedStartTime record component