Package com.illumon.iris.controller
Class IrisQueryScheduler
java.lang.Object
com.illumon.iris.controller.IrisQueryScheduler
- All Implemented Interfaces:
IrisScheduler
- Direct Known Subclasses:
IrisQuerySchedulerContinuous
,IrisQuerySchedulerDaily
,IrisQuerySchedulerDependent
,IrisQuerySchedulerMonthly
,IrisQuerySchedulerTemporary
Base class for basic query scheduling object to contain the parameters used for scheduling. By itself it can not
perform scheduling as it doesn't specify on what days a query should run, it simply specifies start/stop
values. Since it can't handle scheduling by itself, the implementation of the IrisScheduler class is left to
subclasses.
Negative values for startTime and stopTime would be before 1970; they are used to indicate no start or stop time.
This can happen if query scheduling is disabled, or we couldn't find a valid start time within the specified
look-forward time.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected boolean
static final int
protected TimeZone
Fields inherited from interface com.illumon.iris.controller.IrisScheduler
DELIMITER_TOKEN, SCHEDULER_TYPE_TOKEN
-
Method Summary
Modifier and TypeMethodDescriptionboolean
long
Return the repeat interval in minutes.int
Indicate how many minutes to delay between failed query restart attempts.int
Indicate how many times a failed query should be restarted.Get the actual value of restart-when-running.boolean
Return true if scheduling is disabled.getStartTimeDisplay
(String[] strings) long
Return the scheduler's next scheduled start time.Get the schedulers start time as a general time of day.getStopTimeDisplay
(String[] strings) long
Return the scheduler's next scheduled stop time.Get the scheduler's stop time as a general time of day.getTimeZoneDisplay
(String[] strings) Get the time zone string that is used for allLocalTime
sboolean
Return true if the scheduling has a determinable start time.boolean
Return true if the scheduling has a determinable stop time.boolean
Indicate if this scheduler is overnight.boolean
Return true if the scheduling has repeat-interval enabled.boolean
Return true if the determined start time is the first possible one for the day.protected final boolean
boolean
Indicates whether a query should be restarted by the scheduler when running.boolean
Return true if the query scheduling should be skipped if the previous run was unsuccessful.void
validate
(Map<Long, PersistentQueryInfo> allConfigurations) Validate the scheduling.Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.controller.IrisScheduler
areConditionsMet, generateSchedulerTimes, generateStringArrayFromScheduler, getDependentOnQuerySerials, getExpirationTimeMillis, getRunOnFailure, getScheduleDetailDisplay, getTemporaryQueueName, isAutoDelete, populateSchedulerFromStringArray, setDependentOnQuerySerials, updateDependencyState, updateDependencyState
-
Field Details
-
RESTART_COUNT_UNLIMITED
public static final int RESTART_COUNT_UNLIMITED- See Also:
-
timeZone
-
overnight
protected boolean overnight -
DISABLED_PARSE_STRING
- See Also:
-
-
Method Details
-
getRestartWhenRunningValues
-
getRestartWhenRunning
Get the actual value of restart-when-running. This does not define the behavior which can be overridden by subclasses. To determine whether the query should actually restart when running, useshouldRestartWhenRunning()
.- Returns:
- the defined restart-when-running value
-
equals
-
getStartTime
-
getStartTimeOfDay
Description copied from interface:IrisScheduler
Get the schedulers start time as a general time of day. Note that this is not the next absolute start time given byIrisScheduler.getStartTimeInMillis()
- Specified by:
getStartTimeOfDay
in interfaceIrisScheduler
- Returns:
- a
LocalTime
representing the start time of the query
-
getStopTime
-
getStopTimeOfDay
Description copied from interface:IrisScheduler
Get the scheduler's stop time as a general time of day.- Specified by:
getStopTimeOfDay
in interfaceIrisScheduler
- Returns:
- the stop time of the query, if there was one, or null
-
getTimeZoneString
Description copied from interface:IrisScheduler
Get the time zone string that is used for allLocalTime
s- Specified by:
getTimeZoneString
in interfaceIrisScheduler
- Returns:
- the time zone string
-
getSchedulingDisabled
public boolean getSchedulingDisabled()Description copied from interface:IrisScheduler
Return true if scheduling is disabled.- Specified by:
getSchedulingDisabled
in interfaceIrisScheduler
- Returns:
- true if scheduling is disabled, false if scheduling is enabled.
-
getStartTimeInMillis
public long getStartTimeInMillis()Description copied from interface:IrisScheduler
Return the scheduler's next scheduled start time. This must be called afterIrisScheduler.generateSchedulerTimes(Long, Map)
. A value of -1 means there is no start time.- Specified by:
getStartTimeInMillis
in interfaceIrisScheduler
- Returns:
- the query's next start time in millis
-
getStopTimeInMillis
public long getStopTimeInMillis()Description copied from interface:IrisScheduler
Return the scheduler's next scheduled stop time. This must be called afterIrisScheduler.generateSchedulerTimes(Long, Map)
. A value of -1 means there is no stop time.- Specified by:
getStopTimeInMillis
in interfaceIrisScheduler
- Returns:
- the query's next start time in millis
-
hasStopTime
public boolean hasStopTime()Description copied from interface:IrisScheduler
Return true if the scheduling has a determinable stop time.- Specified by:
hasStopTime
in interfaceIrisScheduler
- Returns:
- true if the scheduling has a determinable stop time, false otherwise
-
hasStartTime
public boolean hasStartTime()Return true if the scheduling has a determinable start time.- Returns:
- true if the scheduling has a determinable start time, false otherwise
-
getRestartErrorCount
public int getRestartErrorCount()Description copied from interface:IrisScheduler
Indicate how many times a failed query should be restarted.- Specified by:
getRestartErrorCount
in interfaceIrisScheduler
- Returns:
- the number of times a failed query restart attempt should be made
-
getRestartDelayMinutes
public int getRestartDelayMinutes()Description copied from interface:IrisScheduler
Indicate how many minutes to delay between failed query restart attempts.- Specified by:
getRestartDelayMinutes
in interfaceIrisScheduler
- Returns:
- the number of minutes to delay between failed query restart attempts
-
shouldRestartWhenRunning
public boolean shouldRestartWhenRunning()Description copied from interface:IrisScheduler
Indicates whether a query should be restarted by the scheduler when running.- For a dependent query, indicates whether the query should start immediately if the dependency condition is true and the query is not in a terminal state
- For a continually scheduled query, it indicates that a scheduled restart should cause the running query to be stopped (always true)
- For daily and monthly scheduled queries, it indicates whether a query that's scheduled to start at a specified time should be restarted, even if it's already running (e.g. started manually out of scheduled run-time)
- Specified by:
shouldRestartWhenRunning
in interfaceIrisScheduler
- Returns:
- true if the query should be restarted when its dependent-on condition is met
-
getStartTimeDisplay
- Specified by:
getStartTimeDisplay
in interfaceIrisScheduler
-
getStopTimeDisplay
- Specified by:
getStopTimeDisplay
in interfaceIrisScheduler
-
getTimeZoneDisplay
- Specified by:
getTimeZoneDisplay
in interfaceIrisScheduler
-
getRepeatInterval
public long getRepeatInterval()Description copied from interface:IrisScheduler
Return the repeat interval in minutes.- Specified by:
getRepeatInterval
in interfaceIrisScheduler
- Returns:
- the repeat interval in minutes.
-
isRepeatEnabled
public boolean isRepeatEnabled()Description copied from interface:IrisScheduler
Return true if the scheduling has repeat-interval enabled.- Specified by:
isRepeatEnabled
in interfaceIrisScheduler
- Returns:
- true if the scheduling has repeat-interval enabled, false otherwise
-
skipIfUnsuccessful
public boolean skipIfUnsuccessful()Description copied from interface:IrisScheduler
Return true if the query scheduling should be skipped if the previous run was unsuccessful.- Specified by:
skipIfUnsuccessful
in interfaceIrisScheduler
- Returns:
- true if the query scheduling should be skipped if the previous run was unsuccessful, false otherwise
-
isStartTimeFirstForDay
public boolean isStartTimeFirstForDay()Description copied from interface:IrisScheduler
Return true if the determined start time is the first possible one for the day.- Specified by:
isStartTimeFirstForDay
in interfaceIrisScheduler
- Returns:
- true if the determined start time is the first possible one for the day, false otherwise
-
validate
Description copied from interface:IrisScheduler
Validate the scheduling.- Specified by:
validate
in interfaceIrisScheduler
- Parameters:
allConfigurations
- a map of all current query configurations which can be used for additional validation
-
isOvernight
public boolean isOvernight()Description copied from interface:IrisScheduler
Indicate if this scheduler is overnight.- Specified by:
isOvernight
in interfaceIrisScheduler
- Returns:
- if this scheduler is overnight
-
isStopTimeDisabled
protected final boolean isStopTimeDisabled()
-