Module org.elasticsearch.server
Record Class SchedulerEngine.Job
java.lang.Object
java.lang.Record
org.elasticsearch.common.scheduler.SchedulerEngine.Job
- Record Components:
id- the id of the jobschedule- the schedule which is used to calculate when the job runsfixedStartTime- 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 Summary
ConstructorsConstructorDescriptionJob(String id, SchedulerEngine.Schedule schedule) Job(String id, SchedulerEngine.Schedule schedule, Long fixedStartTime) Creates an instance of aJobrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefixedStartTimerecord component.getId()The following getters are redundant with the getters built in by the record.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.schedule()Returns the value of theschedulerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Job
-
Job
Creates an instance of aJobrecord class.- Parameters:
id- the value for theidrecord componentschedule- the value for theschedulerecord componentfixedStartTime- the value for thefixedStartTimerecord component
-
-
Method Details
-
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
-
getFixedStartTime
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
schedule
Returns the value of theschedulerecord component.- Returns:
- the value of the
schedulerecord component
-
fixedStartTime
Returns the value of thefixedStartTimerecord component.- Returns:
- the value of the
fixedStartTimerecord component
-