Class PerNodeStatisticsCollectionScheduler

java.lang.Object
com.atlassian.crowd.analytics.statistics.scheduler.PerNodeStatisticsCollectionScheduler
All Implemented Interfaces:
StatisticsCollectorRunner, com.atlassian.scheduler.JobRunner

@Named public class PerNodeStatisticsCollectionScheduler extends Object
Schedules and runs per node statistics collection.
  • Constructor Details

    • PerNodeStatisticsCollectionScheduler

      @Inject public PerNodeStatisticsCollectionScheduler(com.atlassian.scheduler.SchedulerService schedulerService, com.atlassian.analytics.api.services.AnalyticsConfigService analyticsConfigService, com.atlassian.event.api.EventPublisher eventPublisher, List<StatisticsCollector<?>> collectors)
  • Method Details

    • shouldBeProcessed

      protected Predicate<StatisticsCollector<?>> shouldBeProcessed()
      Returns a predicate used to filter statistics collectors. Implementation should return their own predicate which will filter only statistics collectors they are interested in running.
      Returns:
      predicate describing whether given statistics collector will be run by scheduler (predicate returns true) or not (predicate return false)
    • getJobId

      protected com.atlassian.scheduler.config.JobId getJobId()
      Returns job ID. Implementations MUST provide unique job ID.
      Returns:
      job ID
    • getJobRunnerKey

      protected com.atlassian.scheduler.config.JobRunnerKey getJobRunnerKey()
      Returns job runner key. Implementations MUST provide unique job runner key.
      Returns:
      job runner key
    • getRunMode

      protected com.atlassian.scheduler.config.RunMode getRunMode()
      Returns:
      run mode
    • onCreate

      @PostConstruct public void onCreate() throws com.atlassian.scheduler.SchedulerServiceException
      Throws:
      com.atlassian.scheduler.SchedulerServiceException
    • onDestroy

      @PreDestroy public void onDestroy()
    • onApplicationReady

      @EventListener public void onApplicationReady(ApplicationReadyEvent applicationStartedEvent) throws com.atlassian.scheduler.SchedulerServiceException
      Throws:
      com.atlassian.scheduler.SchedulerServiceException
    • onXMLRestore

      @EventListener public void onXMLRestore(XMLRestoreFinishedEvent restoreFinishedEvent) throws com.atlassian.scheduler.SchedulerServiceException
      Throws:
      com.atlassian.scheduler.SchedulerServiceException
    • runJob

      public com.atlassian.scheduler.JobRunnerResponse runJob(com.atlassian.scheduler.JobRunnerRequest request)
      Specified by:
      runJob in interface com.atlassian.scheduler.JobRunner
    • collect

      public void collect()
      Specified by:
      collect in interface StatisticsCollectorRunner