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

      Fields 
      Modifier and Type Field Description
      static long ALL_JOBS_TTL_MILLIS
      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 granularity
      static long UNSUCCESSFUL_JOBS_TTL_MILLIS
      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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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
      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
      org.apache.commons.lang3.tuple.Pair<Integer,​Integer> purgeOldRunDetails()
      This method purges the old run details, i.e.
    • Field Detail

      • ALL_JOBS_TTL_MILLIS

        static final long ALL_JOBS_TTL_MILLIS
        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 granularity
      • UNSUCCESSFUL_JOBS_TTL_MILLIS

        static final long UNSUCCESSFUL_JOBS_TTL_MILLIS
        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 Detail

      • purgeOldRunDetails

        org.apache.commons.lang3.tuple.Pair<Integer,​Integer> purgeOldRunDetails()
        This method purges the old run details, i.e. before or 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 threshold
        runOutcome - 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 ID
        startedAt - when the job is started
        runOutcome - the run outcome
        message - the message