Interface SchedulerRunDetailsManager
- All Known Implementing Classes:
DefaultSchedulerRunDetailsManager
@Internal
@Transactional
public interface SchedulerRunDetailsManager
This manager is for internal processing of the scheduler run details (aka. job history)
stored in the scheduler_run_details table
- Since:
- 6.4.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
The time-to-live of outdated run details that will be purged The default value is 90 days, which can be overridden by the system property "all.jobs.ttl.minutes" with the hour granularitystatic final long
The time-to-live of unsuccessful run details that will be purged The default value is 7 days, which can be overridden by the system property "unsuccessful.jobs.ttl.hours" with the hour granularity -
Method Summary
Modifier and TypeMethodDescriptioncom.atlassian.scheduler.status.RunDetails
addRunDetails
(com.atlassian.scheduler.config.JobId jobId, Date startedAt, com.atlassian.scheduler.status.RunOutcome runOutcome, @Nullable String message) Delegates the task to the underlying Scheduler Service since the ConfluenceSchedulerService bean is not accessible from the add-onlong
count
(com.atlassian.scheduler.config.JobId jobId, long timeToLiveThreshold, com.atlassian.scheduler.status.RunOutcome runOutcome) Count the job's run details that are stored before a time-to-live threshold in millisecondsThis method purges the old run details, i.e.
-
Field Details
-
ALL_JOBS_TTL_MILLIS
static final long ALL_JOBS_TTL_MILLISThe time-to-live of outdated run details that will be purged The default value is 90 days, which can be overridden by the system property "all.jobs.ttl.minutes" with the hour granularity -
UNSUCCESSFUL_JOBS_TTL_MILLIS
static final long UNSUCCESSFUL_JOBS_TTL_MILLISThe time-to-live of unsuccessful run details that will be purged The default value is 7 days, which can be overridden by the system property "unsuccessful.jobs.ttl.hours" with the hour granularity
-
-
Method Details
-
purgeOldRunDetails
This method purges the old run details, i.e. beforeor DefaultSchedulerRunDetailsManager#UNSUCCESSFUL_JOBS_TTL_MILLIS
This prevents the table space from growing without bounds, and it is unlikely that you really care about the results of a scheduled job that hasn't run in that long, anyway.- Returns:
- a Pair in which the left value is the number of total records purged and the right values is the number of batches
-
count
long count(com.atlassian.scheduler.config.JobId jobId, long timeToLiveThreshold, com.atlassian.scheduler.status.RunOutcome runOutcome) Count the job's run details that are stored before a time-to-live threshold in milliseconds- Parameters:
timeToLiveThreshold
- the TTL thresholdrunOutcome
- the run outcome that should be matched- Returns:
- the total count of job runs that satisfies the timeToLiveThreshold
-
addRunDetails
com.atlassian.scheduler.status.RunDetails addRunDetails(com.atlassian.scheduler.config.JobId jobId, Date startedAt, com.atlassian.scheduler.status.RunOutcome runOutcome, @Nullable String message) Delegates the task to the underlying Scheduler Service since the ConfluenceSchedulerService bean is not accessible from the add-on- Parameters:
jobId
- the Job IDstartedAt
- when the job is startedrunOutcome
- the run outcomemessage
- the message
-