deephaven_enterprise.client.generate_scheduling¶
- class GenerateScheduling[source]¶
Bases:
object
GenerateScheduling contains helper methods to generate scheduling arrays for use in persistent queries.
- static generate_continuous_scheduler(start_time, time_zone='America/New_York', restart_daily=False, restart_error_count=0, restart_error_delay_minutes=0)[source]¶
Generate a scheduler array for a persistent query that has continuous scheduling.
- Parameters:
start_time (
str
) – the query’s restart time in HH:MM:SS formattime_zone (
str
) – the time zone, such as ‘America/New_York’ or ‘Europe/London’restart_daily (
bool
) – if True, then the query should be restarted every day at the defined start_timerestart_error_count (
int
) – the number of times a failing query will attempt to be restarted within its run windowrestart_error_delay_minutes (
int
) – the delay in minutes between attempting to restart a failed query
- Return type:
- Returns:
a scheduling definition array that can be passed to the controller when adding or updating a persistent query
- static generate_daily_scheduler(start_time, stop_time, time_zone='America/New_York', business_days=False, calendar='USNYSE', days=[True, True, True, True, True, True, True], overnight=False, repeat_enabled=False, repeat_interval=0, skip_if_unsuccessful=False, stop_time_disabled=False, restart_error_count=0, restart_error_delay_minutes=0, restart_when_running='Yes')[source]¶
Generate a scheduler array for a persistent query that has daily scheduling.
- Parameters:
start_time (
str
) – the query’s starting time in HH:MM:SS formatstop_time (
str
) – the query’s stop time in HH:MM:SS formattime_zone (
str
) – the time zone, such as ‘America/New_York’ or ‘Europe/London’business_days (
bool
) – if changed to True, only run on business dayscalendar (
str
) – if business_days is True, the business calendar to usedays (
List
[bool
]) – a list of bool values representing the days to run the persistent query, from Monday through Sundayovernight (
bool
) – if True, the query runs overnightrepeat_enabled (
bool
) – for batch-style queries, if True, the persistent query will be restarted at the repeat_interval intervalrepeat_interval (
int
) – if repeat_enabled is True, the interval in minutes between restartsskip_if_unsuccessful (
bool
) – for repeating queries, skip if the previous run failed when this is Truestop_time_disabled (
bool
) – if True, the persistent query does not need a stop time (for example, non-repeating batch queries)restart_error_count (
int
) – the number of times a failing query will attempt to be restarted within its run windowrestart_error_delay_minutes (
int
) – the delay in minutes between attempting to restart a failed queryrestart_when_running (
str
) – if ‘Yes’ then the query will be restarted when running at its start time, if ‘No’ it will be left running
- Return type:
- Returns:
a scheduling definition array that can be passed to the controller when adding or updating a persistent query
- static generate_dependent_scheduler(start_time, stop_time, time_zone='America/New_York', dependent_query_serials=None, run_on_failure=False, restart_on_condition=False, run_on_any_dependency_met=False, use_minimum_start_time=False, run_each_time=False, deadline_start='00:00:00', deadline_end='23:59:59', overnight=False, repeat_enabled=False, repeat_interval=0, skip_if_unsuccessful=False, stop_time_disabled=False, restart_error_count=0, restart_error_delay_minutes=0, restart_when_running='Yes')[source]¶
Generate a scheduler array for a persistent query that has dependent scheduling.
- Parameters:
start_time (
str
) – the query’s starting time in HH:MM:SS formatstop_time (
str
) – the query’s stop time in HH:MM:SS formattime_zone (
str
) – the time zone, such as ‘America/New_York’ or ‘Europe/London’dependent_query_serials (
Optional
[List
[int
]]) – a list of serials on which the query is dependentrun_on_failure (
bool
) – if True, run when dependencies fail (rather than succeed)restart_on_condition (
bool
) – if True, restart when conditions are met even if the query is running at the timerun_on_any_dependency_met (
bool
) – if True, run when any dependency is met, otherwise all dependencies must be metuse_minimum_start_time (
bool
) – if True, delay start of query after dependencies are met until the specified start_timerun_each_time (
bool
) – if True, run every time dependencies are met, otherwise run once each daydeadline_start (
str
) – the start of the time at which the query should respond to dependency changes, in HH:MM:SS formatdeadline_end (
str
) – the end of the time at which the query should respond to dependency changes, in HH:MM:SS formatovernight (
bool
) – if True, the query runs overnightrepeat_enabled (
bool
) – for batch-style queries, if True, the persistent query will be restarted at the repeat_interval intervalrepeat_interval (
int
) – if repeat_enabled is True, the interval in minutes between restartsskip_if_unsuccessful (
bool
) – for repeating queries, skip if the previous run failed when this is Truestop_time_disabled (
bool
) – if True, the persistent query does not need a stop time (for example, non-repeating batch queries)restart_error_count (
int
) – the number of times a failing query will attempt to be restarted within its run windowrestart_error_delay_minutes (
int
) – the delay in minutes between attempting to restart a failed queryrestart_when_running (
str
) – if ‘Yes’ then the query will be restarted when running at its start time, if ‘No’ it will be left running
- Return type:
- Returns:
a scheduling definition array that can be passed to the controller when adding or updating a persistent query
- static generate_disabled_scheduler()[source]¶
Generates a scheduler array for a persistent query with scheduling disabled.
- static generate_monthly_scheduler(start_time, stop_time, time_zone='America/New_York', business_days=False, calendar='USNYSE', first_business_day=False, last_business_day=False, months=[True, True, True, True, True, True, True, True, True, True, True, True], days=None, overnight=False, repeat_enabled=False, repeat_interval=0, skip_if_unsuccessful=False, stop_time_disabled=False, restart_error_count=0, restart_error_delay_minutes=0, restart_when_running='Yes')[source]¶
Generate a scheduler array for a persistent query that has monthly scheduling.
- Parameters:
start_time (
str
) – the query’s starting time in HH:MM:SS formatstop_time (
str
) – the query’s stop time in HH:MM:SS formattime_zone (
str
) – the time zone, such as ‘America/New_York’ or ‘Europe/London’business_days (
bool
) – if changed to True, only run on business dayscalendar (
str
) – if business_days is True, the business calendar to usefirst_business_day (
bool
) – if True, then run the query on the first business day of the monthlast_business_day (
bool
) – if True, then run the query on the last business day of the monthmonths (
List
[bool
]) – a List of the months on which the persistent query will be started, starting with Januarydays (
Optional
[List
[int
]]) – a list of specific days (from 1 to 31) to run the persistent query for each month, or None if this is not neededovernight (
bool
) – if True, the query runs overnightrepeat_enabled (
bool
) – for batch-style queries, if True, the persistent query will be restarted at the repeat_interval intervalrepeat_interval (
int
) – if repeat_enabled is True, the interval in minutes between restartsskip_if_unsuccessful (
bool
) – for repeating queries, skip if the previous run failed when this is Truestop_time_disabled (
bool
) – if True, the persistent query does not need a stop time (for example, non-repeating batch queries)restart_error_count (
int
) – the number of times a failing query will attempt to be restarted within its run windowrestart_error_delay_minutes (
int
) – the delay in minutes between attempting to restart a failed queryrestart_when_running (
str
) – if ‘Yes’ then the query will be restarted when running at its start time, if ‘No’ it will be left running
- Return type:
- Returns:
a scheduling definition array that can be passed to the controller when adding or updating a persistent query
- static generate_range_scheduler(start_time, stop_time, start_date, end_date, time_zone='America/New_York', repeat_enabled=False, repeat_interval=0, skip_if_unsuccessful=False, restart_error_count=0, restart_error_delay_minutes=0, restart_when_running='Yes')[source]¶
Generate a scheduler array for a persistent query that has range scheduling.
- Parameters:
start_time (
str
) – the query’s starting time in HH:MM:SS format, or None if no start date/time will be usedstop_time (
str
) – the query’s stop time in HH:MM:SS format, or None if no stop date/time will be usedstart_date (
str
) – the query’s start date in YYYY-MM-DD format, or None if no start date/time will be usedend_date (
str
) – the query’s end date in YYYY-MM-DD format, or None if no stop date/time will be usedtime_zone (
str
) – the time zone, such as ‘America/New_York’ or ‘Europe/London’repeat_enabled (
bool
) – for batch-style queries, if True, the persistent query will be restarted at the repeat_interval intervalrepeat_interval (
int
) – if repeat_enabled is True, the interval in minutes between restartsskip_if_unsuccessful (
bool
) – for repeating queries, skip if the previous run failed when this is Truerestart_error_count (
int
) – the number of times a failing query will attempt to be restarted within its run windowrestart_error_delay_minutes (
int
) – the delay in minutes between attempting to restart a failed queryrestart_when_running (
str
) – if ‘Yes’ then the query will be restarted when running at its start time, if ‘No’ it will be left running
- Return type:
- Returns:
a scheduling definition array that can be passed to the controller when adding or updating a persistent query
- static generate_temporary_scheduler(queue_name='DefaultTemporaryQueue', restart_error_count=0, restart_error_delay_minutes=0, auto_delete=True, expiration_time_minutes=1440, dependent_query_serial=None)[source]¶
Generate a scheduler array for a persistent query that has temporary scheduling.
- Parameters:
queue_name (
str
) – the temporary queue namerestart_error_count (
int
) – the number of times a failing query will attempt to be restarted within its run windowrestart_error_delay_minutes (
int
) – the delay in minutes between attempting to restart a failed queryauto_delete (
bool
) – if True, automatically delete the PQ after it’s completedexpiration_time_minutes (
int
) – the time in minutes after which the temporary query will automatically be deleted (defaults to 1 day)dependent_query_serial (
Optional
[int
]) – a single optional query on which the temporary query is dependent
- Return type:
- Returns:
a scheduling definition array that can be passed to the controller when adding or updating a persistent query