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,IrisQuerySchedulerRange,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 Stringprotected booleanstatic final intprotected TimeZoneFields inherited from interface com.illumon.iris.controller.IrisScheduler
DELIMITER_TOKEN, SCHEDULER_TYPE_TOKEN -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanIndicate whether default validation should enforce the start and stop time ordering.booleanlongReturn the repeat interval in minutes.intIndicate how many minutes to delay between failed query restart attempts.intIndicate how many times a failed query should be restarted.Get the actual value of restart-when-running.booleanReturn true if scheduling is disabled.getStartTimeDisplay(String[] strings) longReturn the scheduler's next scheduled start time.Get the schedulers start time as a general time of day.getStopTimeDisplay(String[] strings) longReturn 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 allLocalTimesbooleanReturn true if the scheduling has a determinable start time.booleanReturn true if the scheduling has a determinable stop time.booleanIndicate if this scheduler is overnight.booleanReturn true if the scheduling has repeat-interval enabled.booleanReturn true if the determined start time is the first possible one for the day.protected final booleanbooleanIndicates whether a query should be restarted by the scheduler when running.booleanReturn true if the query scheduling should be skipped if the previous run was unsuccessful.voidvalidate(Map<Long, PersistentQueryInfo> allConfigurations) Validate the scheduling.Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.controller.IrisScheduler
areConditionsMet, copy, 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
-
copyBaseFieldsFrom
-
equals
-
getStartTime
-
getStartTimeOfDay
Description copied from interface:IrisSchedulerGet 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:
getStartTimeOfDayin interfaceIrisScheduler- Returns:
- a
LocalTimerepresenting the start time of the query
-
getStopTime
-
getStopTimeOfDay
Description copied from interface:IrisSchedulerGet the scheduler's stop time as a general time of day.- Specified by:
getStopTimeOfDayin interfaceIrisScheduler- Returns:
- the stop time of the query, if there was one, or null
-
getTimeZoneString
Description copied from interface:IrisSchedulerGet the time zone string that is used for allLocalTimes- Specified by:
getTimeZoneStringin interfaceIrisScheduler- Returns:
- the time zone string
-
getSchedulingDisabled
public boolean getSchedulingDisabled()Description copied from interface:IrisSchedulerReturn true if scheduling is disabled.- Specified by:
getSchedulingDisabledin interfaceIrisScheduler- Returns:
- true if scheduling is disabled, false if scheduling is enabled.
-
getStartTimeInMillis
public long getStartTimeInMillis()Description copied from interface:IrisSchedulerReturn 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:
getStartTimeInMillisin interfaceIrisScheduler- Returns:
- the query's next start time in millis
-
getStopTimeInMillis
public long getStopTimeInMillis()Description copied from interface:IrisSchedulerReturn 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:
getStopTimeInMillisin interfaceIrisScheduler- Returns:
- the query's next start time in millis
-
hasStopTime
public boolean hasStopTime()Description copied from interface:IrisSchedulerReturn true if the scheduling has a determinable stop time.- Specified by:
hasStopTimein 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:IrisSchedulerIndicate how many times a failed query should be restarted.- Specified by:
getRestartErrorCountin interfaceIrisScheduler- Returns:
- the number of times a failed query restart attempt should be made
-
getRestartDelayMinutes
public int getRestartDelayMinutes()Description copied from interface:IrisSchedulerIndicate how many minutes to delay between failed query restart attempts.- Specified by:
getRestartDelayMinutesin interfaceIrisScheduler- Returns:
- the number of minutes to delay between failed query restart attempts
-
shouldRestartWhenRunning
public boolean shouldRestartWhenRunning()Description copied from interface:IrisSchedulerIndicates 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:
shouldRestartWhenRunningin interfaceIrisScheduler- Returns:
- true if the query should be restarted when its dependent-on condition is met
-
getStartTimeDisplay
- Specified by:
getStartTimeDisplayin interfaceIrisScheduler
-
getStopTimeDisplay
- Specified by:
getStopTimeDisplayin interfaceIrisScheduler
-
getTimeZoneDisplay
- Specified by:
getTimeZoneDisplayin interfaceIrisScheduler
-
getRepeatInterval
public long getRepeatInterval()Description copied from interface:IrisSchedulerReturn the repeat interval in minutes.- Specified by:
getRepeatIntervalin interfaceIrisScheduler- Returns:
- the repeat interval in minutes.
-
isRepeatEnabled
public boolean isRepeatEnabled()Description copied from interface:IrisSchedulerReturn true if the scheduling has repeat-interval enabled.- Specified by:
isRepeatEnabledin interfaceIrisScheduler- Returns:
- true if the scheduling has repeat-interval enabled, false otherwise
-
skipIfUnsuccessful
public boolean skipIfUnsuccessful()Description copied from interface:IrisSchedulerReturn true if the query scheduling should be skipped if the previous run was unsuccessful.- Specified by:
skipIfUnsuccessfulin 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:IrisSchedulerReturn true if the determined start time is the first possible one for the day.- Specified by:
isStartTimeFirstForDayin interfaceIrisScheduler- Returns:
- true if the determined start time is the first possible one for the day, false otherwise
-
validate
Description copied from interface:IrisSchedulerValidate the scheduling.- Specified by:
validatein 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:IrisSchedulerIndicate if this scheduler is overnight.- Specified by:
isOvernightin interfaceIrisScheduler- Returns:
- if this scheduler is overnight
-
enforceStartStopTimeOrder
public boolean enforceStartStopTimeOrder()Description copied from interface:IrisSchedulerIndicate whether default validation should enforce the start and stop time ordering. If this is false (for example when it's a multi-day scheduler), the scheduler implementation should enforce start and stop ordering in itsIrisScheduler.validate(java.util.Map<java.lang.Long, com.illumon.iris.controller.PersistentQueryInfo>)implementation.- Specified by:
enforceStartStopTimeOrderin interfaceIrisScheduler- Returns:
- true if default validation should enforce the start and stop time ordering
-
isStopTimeDisabled
protected final boolean isStopTimeDisabled()
-