Package org.opensearch.jobscheduler.spi
Interface ScheduledJobParameter
- All Superinterfaces:
org.opensearch.common.xcontent.ToXContent,org.opensearch.common.xcontent.ToXContentObject
public interface ScheduledJobParameter
extends org.opensearch.common.xcontent.ToXContentObject
Job parameters that being used by the JobScheduler.
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and Type Method Description java.time.InstantgetEnabledTime()default java.lang.DoublegetJitter()Job will be delayed randomly with range of (0, jitter)*interval for the next execution time.java.time.InstantgetLastUpdateTime()default java.lang.LonggetLockDurationSeconds()java.lang.StringgetName()SchedulegetSchedule()booleanisEnabled()
-
Method Details
-
getName
java.lang.String getName()- Returns:
- job name.
-
getLastUpdateTime
java.time.Instant getLastUpdateTime()- Returns:
- job last update time.
-
getEnabledTime
java.time.Instant getEnabledTime()- Returns:
- get job enabled time.
-
getSchedule
Schedule getSchedule()- Returns:
- job schedule.
-
isEnabled
boolean isEnabled()- Returns:
- true if job is enabled, false otherwise.
-
getLockDurationSeconds
default java.lang.Long getLockDurationSeconds()- Returns:
- Null if scheduled job doesn't need lock. Seconds of lock duration if the scheduled job needs to be a singleton runner.
-
getJitter
default java.lang.Double getJitter()Job will be delayed randomly with range of (0, jitter)*interval for the next execution time. For example, if next run is 10 minutes later, jitter is 0.6, then next job run will be randomly delayed by 0 to 6 minutes. Jitter is percentage, so it should be positive and less than 1.Note: default logic for these cases: 1).If jitter is not set, will regard it as 0.0. 2).If jitter is negative, will reset it as 0.0. 3).If jitter exceeds jitter limit, will cap it as jitter limit. Default jitter limit is 0.95. So if you set jitter as 0.96, will cap it as 0.95.
- Returns:
- job execution jitter
-