Package com.illumon.iris.controller
Class IrisQuerySchedulerDependent
java.lang.Object
com.illumon.iris.controller.IrisQueryScheduler
com.illumon.iris.controller.IrisQuerySchedulerDependent
- All Implemented Interfaces:
IrisScheduler
public class IrisQuerySchedulerDependent extends IrisQueryScheduler implements IrisScheduler
-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.controller.IrisQueryScheduler
IrisQueryScheduler.RestartWhenRunning
-
Field Summary
Fields Modifier and Type Field Description static String
DEADLINE_END_STRING
static String
DEADLINE_START_STRING
static String
DEPENDENT_QUERY_SERIAL_STRING
static String
RESTART_ON_CONDITION_STRING
static String
RUN_EACH_STRING
static String
RUN_ON_ANY_STRING
static String
RUN_ON_FAILURE_STRING
static String
USE_MIN_START_TIME_STRING
Fields inherited from class com.illumon.iris.controller.IrisQueryScheduler
DISABLED_PARSE_STRING, overnight, RESTART_COUNT_UNLIMITED, timeZone
Fields inherited from interface com.illumon.iris.controller.IrisScheduler
DELIMITER_TOKEN, SCHEDULER_TYPE_TOKEN
-
Constructor Summary
Constructors Constructor Description IrisQuerySchedulerDependent()
IrisQuerySchedulerDependent(String startTime, String stopTime, String timeZone, boolean schedulingDisabled, boolean overnight, boolean repeatEnabled, String repeatInterval, boolean skipIfUnsuccessful, boolean stopTimeDisabled, int errorRestartCount, boolean runOnFailure, boolean restartOnCondition, List<Long> dependentOnQuerySerials, String restartDelayMinutes, boolean useMinimumStartTime, boolean runOnAny, String deadlineStartTime, String deadlineEndTime, boolean runEveryTime, IrisQueryScheduler.RestartWhenRunning restartWhenRunning)
-
Method Summary
Modifier and Type Method Description boolean
areConditionsMet()
Check if the dependency conditions for running have been met.boolean
equals(Object object)
void
generateSchedulerTimes(Long lookPastTime, Map<Long,PersistentQueryInfo> queryInfos)
Generate the next start/stop time values for this query.String[]
generateStringArrayFromScheduler()
LocalTime
getDeadlineStartTime()
LocalTime
getDeadlineStopTime()
List<Long>
getDependentOnQuerySerials()
Return the list of query serials on which this query is dependent.boolean
getRunOnFailure()
For a dependent query, indicates whether the query should run after a failure instead of after a success.String
getScheduleDetailDisplay(String[] strings, Map<Long,PersistentQueryInfo> queryInfos)
Create a displayable string for the detailed scheduling conditions.boolean
hasStartTime()
Return true if the scheduling has a determinable start time.boolean
isRunEvery()
boolean
isRunOnAny()
void
populateSchedulerFromStringArray(String[] strings)
void
setDependentOnQuerySerials(List<Long> newDependentOnQuerySerials)
Set the dependent-on query serials.boolean
shouldRestartWhenRunning()
Indicates whether a query should be restarted by the scheduler when running.boolean
updateDependencyState(Long serial, PersistentQueryState.Status status)
For a dependent query, update the dependency state with the passed in state, and indicate if all required dependencies have been met.void
validate(Map<Long,PersistentQueryInfo> allConfigurations)
Validate the scheduling.Methods inherited from class com.illumon.iris.controller.IrisQueryScheduler
getRepeatInterval, getRestartDelayMinutes, getRestartErrorCount, getRestartWhenRunning, getRestartWhenRunningValues, getSchedulingDisabled, getStartTime, getStartTimeDisplay, getStartTimeInMillis, getStartTimeOfDay, getStopTime, getStopTimeDisplay, getStopTimeInMillis, getStopTimeOfDay, getTimeZoneDisplay, getTimeZoneString, hasStopTime, isOvernight, isRepeatEnabled, isStartTimeFirstForDay, isStopTimeDisabled, skipIfUnsuccessful
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
getExpirationTimeMillis, getRepeatInterval, getRestartDelayMinutes, getRestartErrorCount, getSchedulingDisabled, getStartTimeDisplay, getStartTimeInMillis, getStartTimeOfDay, getStopTimeDisplay, getStopTimeInMillis, getStopTimeOfDay, getTemporaryQueueName, getTimeZoneDisplay, getTimeZoneString, hasStopTime, isOvernight, isRepeatEnabled, isStartTimeFirstForDay, skipIfUnsuccessful, updateDependencyState
-
Field Details
-
RUN_ON_FAILURE_STRING
- See Also:
- Constant Field Values
-
RESTART_ON_CONDITION_STRING
- See Also:
- Constant Field Values
-
DEPENDENT_QUERY_SERIAL_STRING
- See Also:
- Constant Field Values
-
USE_MIN_START_TIME_STRING
- See Also:
- Constant Field Values
-
RUN_ON_ANY_STRING
- See Also:
- Constant Field Values
-
DEADLINE_START_STRING
- See Also:
- Constant Field Values
-
DEADLINE_END_STRING
- See Also:
- Constant Field Values
-
RUN_EACH_STRING
- See Also:
- Constant Field Values
-
-
Constructor Details
-
IrisQuerySchedulerDependent
public IrisQuerySchedulerDependent() -
IrisQuerySchedulerDependent
public IrisQuerySchedulerDependent(String startTime, String stopTime, String timeZone, boolean schedulingDisabled, boolean overnight, boolean repeatEnabled, String repeatInterval, boolean skipIfUnsuccessful, boolean stopTimeDisabled, int errorRestartCount, boolean runOnFailure, boolean restartOnCondition, List<Long> dependentOnQuerySerials, String restartDelayMinutes, boolean useMinimumStartTime, boolean runOnAny, String deadlineStartTime, String deadlineEndTime, boolean runEveryTime, IrisQueryScheduler.RestartWhenRunning restartWhenRunning)
-
-
Method Details
-
generateStringArrayFromScheduler
- Specified by:
generateStringArrayFromScheduler
in interfaceIrisScheduler
-
populateSchedulerFromStringArray
- Specified by:
populateSchedulerFromStringArray
in interfaceIrisScheduler
-
equals
- Overrides:
equals
in classIrisQueryScheduler
-
getScheduleDetailDisplay
public String getScheduleDetailDisplay(String[] strings, Map<Long,PersistentQueryInfo> queryInfos)Create a displayable string for the detailed scheduling conditions.- Specified by:
getScheduleDetailDisplay
in interfaceIrisScheduler
-
generateSchedulerTimes
Description copied from interface:IrisScheduler
Generate the next start/stop time values for this query. Generated values of -1 will be used to indicate no start or stop time. After calling this, calling getStartTimeInMillis will return the generated start time and calling getStopTimeInMillis will return the generated stop time.- Specified by:
generateSchedulerTimes
in interfaceIrisScheduler
- Parameters:
lookPastTime
- the time in millis past which the scheduling engine looks for the next start time, or null if none is desiredqueryInfos
- the controller's query information Map
-
updateDependencyState
Description copied from interface:IrisScheduler
For a dependent query, update the dependency state with the passed in state, and indicate if all required dependencies have been met.- Specified by:
updateDependencyState
in interfaceIrisScheduler
- Parameters:
serial
- the serial of the dependency querystatus
- the status of the dependency query- Returns:
- true if all required dependency conditions are met for this query
-
areConditionsMet
public boolean areConditionsMet()Description copied from interface:IrisScheduler
Check if the dependency conditions for running have been met.- Specified by:
areConditionsMet
in interfaceIrisScheduler
- Returns:
- true if the query has met it dependency conditions
-
validate
Description copied from interface:IrisScheduler
Validate the scheduling.- Specified by:
validate
in interfaceIrisScheduler
- Overrides:
validate
in classIrisQueryScheduler
- Parameters:
allConfigurations
- a map of all current query configurations which can be used for additional validation
-
getRunOnFailure
public boolean getRunOnFailure()Description copied from interface:IrisScheduler
For a dependent query, indicates whether the query should run after a failure instead of after a success.- Specified by:
getRunOnFailure
in interfaceIrisScheduler
- Returns:
- true if the dependency is for failed dependent-on runs, false if it's for Running/Completed conditions
-
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
- Overrides:
shouldRestartWhenRunning
in classIrisQueryScheduler
- Returns:
- true if the query should be restarted when its dependent-on condition is met
-
getDependentOnQuerySerials
Description copied from interface:IrisScheduler
Return the list of query serials on which this query is dependent.- Specified by:
getDependentOnQuerySerials
in interfaceIrisScheduler
- Returns:
- the dependent-on query serial list, or null if this is not a dependent query
-
setDependentOnQuerySerials
Description copied from interface:IrisScheduler
Set the dependent-on query serials. For example, this may be done when importing queries from another controller.- Specified by:
setDependentOnQuerySerials
in interfaceIrisScheduler
- Parameters:
newDependentOnQuerySerials
- the new dependency list
-
hasStartTime
public boolean hasStartTime()Description copied from class:IrisQueryScheduler
Return true if the scheduling has a determinable start time.- Overrides:
hasStartTime
in classIrisQueryScheduler
- Returns:
- true if the scheduling has a determinable start time, false otherwise
-
isRunOnAny
public boolean isRunOnAny() -
getDeadlineStartTime
-
getDeadlineStopTime
-
isRunEvery
public boolean isRunEvery()
-