@Configuration @EnableScheduling @EnableConfigurationProperties(value={ClusterCheckerProperties.class,DatabaseCleanupProperties.class,DiskCleanupProperties.class,TasksExecutorPoolProperties.class,TasksSchedulerPoolProperties.class,UserMetricsProperties.class,AgentCleanupProperties.class}) public class GenieTasksAutoConfiguration extends java.lang.Object
Constructor and Description |
---|
GenieTasksAutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
AgentJobCleanupTask |
agentJobCleanupTask(JobSearchService jobSearchService,
JobPersistenceService jobPersistenceService,
AgentCleanupProperties agentCleanupProperties,
io.micrometer.core.instrument.MeterRegistry registry)
If required, get a
AgentJobCleanupTask instance for use. |
ClusterCheckerTask |
clusterCheckerTask(GenieHostInfo genieHostInfo,
ClusterCheckerProperties properties,
JobSearchService jobSearchService,
JobPersistenceService jobPersistenceService,
org.springframework.web.client.RestTemplate restTemplate,
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties webEndpointProperties,
io.micrometer.core.instrument.MeterRegistry registry)
Create a
ClusterCheckerTask if one hasn't been supplied. |
DatabaseCleanupTask |
databaseCleanupTask(DatabaseCleanupProperties cleanupProperties,
JobPersistenceService jobPersistenceService,
ClusterPersistenceService clusterPersistenceService,
FilePersistenceService filePersistenceService,
TagPersistenceService tagPersistenceService,
io.micrometer.core.instrument.MeterRegistry registry)
Create a
DatabaseCleanupTask if one is required. |
DiskCleanupTask |
diskCleanupTask(DiskCleanupProperties properties,
org.springframework.scheduling.TaskScheduler scheduler,
org.springframework.core.io.Resource jobsDir,
JobSearchService jobSearchService,
JobsProperties jobsProperties,
org.apache.commons.exec.Executor processExecutor,
io.micrometer.core.instrument.MeterRegistry registry)
If required get a
DiskCleanupTask instance for use. |
org.springframework.core.task.AsyncTaskExecutor |
genieAsyncTaskExecutor(TasksExecutorPoolProperties tasksExecutorPoolProperties)
Get a task executor for executing tasks asynchronously that don't need to be scheduled at a recurring rate.
|
org.springframework.core.task.SyncTaskExecutor |
genieSyncTaskExecutor()
Synchronous task executor.
|
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler |
genieTaskScheduler(TasksSchedulerPoolProperties tasksSchedulerPoolProperties)
Get a task scheduler.
|
org.springframework.scheduling.TaskScheduler |
heartBeatServiceTaskScheduler()
Get the task scheduler used by the HeartBeat Service.
|
org.apache.commons.exec.Executor |
processExecutor()
Get an
Executor to use for executing processes from tasks. |
UserMetricsTask |
userMetricsTask(io.micrometer.core.instrument.MeterRegistry registry,
JobSearchService jobSearchService,
UserMetricsProperties userMetricsProperties)
If required get a
UserMetricsTask instance for use. |
@Bean @ConditionalOnMissingBean(value=org.apache.commons.exec.Executor.class) public org.apache.commons.exec.Executor processExecutor()
Executor
to use for executing processes from tasks.@Bean @ConditionalOnMissingBean(name="genieTaskScheduler") public org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler genieTaskScheduler(TasksSchedulerPoolProperties tasksSchedulerPoolProperties)
tasksSchedulerPoolProperties
- The properties regarding the thread pool to use for task scheduling@Bean @ConditionalOnMissingBean(name="heartBeatServiceTaskScheduler") public org.springframework.scheduling.TaskScheduler heartBeatServiceTaskScheduler()
@Bean @ConditionalOnMissingBean(name="genieAsyncTaskExecutor") public org.springframework.core.task.AsyncTaskExecutor genieAsyncTaskExecutor(TasksExecutorPoolProperties tasksExecutorPoolProperties)
tasksExecutorPoolProperties
- The properties for the task executor thread pool@Bean @ConditionalOnMissingBean(name="genieSyncTaskExecutor") public org.springframework.core.task.SyncTaskExecutor genieSyncTaskExecutor()
@Bean @ConditionalOnMissingBean(value=ClusterCheckerTask.class) public ClusterCheckerTask clusterCheckerTask(GenieHostInfo genieHostInfo, ClusterCheckerProperties properties, JobSearchService jobSearchService, JobPersistenceService jobPersistenceService, @Qualifier(value="genieRestTemplate") org.springframework.web.client.RestTemplate restTemplate, org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties webEndpointProperties, io.micrometer.core.instrument.MeterRegistry registry)
ClusterCheckerTask
if one hasn't been supplied.genieHostInfo
- Information about the host this Genie process is running onproperties
- The properties to use to configure the taskjobSearchService
- The job search service to usejobPersistenceService
- The job persistence service to userestTemplate
- The rest template for http callswebEndpointProperties
- The properties where Spring actuator is runningregistry
- The spectator registry for getting metricsClusterCheckerTask
instance@Bean @ConditionalOnProperty(value="genie.tasks.database-cleanup.enabled", havingValue="true") @ConditionalOnMissingBean(value=DatabaseCleanupTask.class) public DatabaseCleanupTask databaseCleanupTask(DatabaseCleanupProperties cleanupProperties, JobPersistenceService jobPersistenceService, ClusterPersistenceService clusterPersistenceService, FilePersistenceService filePersistenceService, TagPersistenceService tagPersistenceService, io.micrometer.core.instrument.MeterRegistry registry)
DatabaseCleanupTask
if one is required.cleanupProperties
- The properties to use to configure this taskjobPersistenceService
- The persistence service to use to cleanup the data storeclusterPersistenceService
- The cluster service to use to delete terminated clustersfilePersistenceService
- The file service to use to delete unused file referencestagPersistenceService
- The tag service to use to delete unused tag referencesregistry
- The metrics registryDatabaseCleanupTask
instance to use if the conditions match@Bean @ConditionalOnProperty(value="genie.tasks.disk-cleanup.enabled", havingValue="true") @ConditionalOnMissingBean(value=DiskCleanupTask.class) public DiskCleanupTask diskCleanupTask(DiskCleanupProperties properties, @Qualifier(value="genieTaskScheduler") org.springframework.scheduling.TaskScheduler scheduler, org.springframework.core.io.Resource jobsDir, JobSearchService jobSearchService, JobsProperties jobsProperties, org.apache.commons.exec.Executor processExecutor, io.micrometer.core.instrument.MeterRegistry registry) throws java.io.IOException
DiskCleanupTask
instance for use.properties
- The disk cleanup properties to use.scheduler
- The scheduler to use to schedule the cron trigger.jobsDir
- The resource representing the location of the job directoryjobSearchService
- The service to find jobs withjobsProperties
- The jobs properties to useprocessExecutor
- The process executor to use to delete directoriesregistry
- The metrics registryDiskCleanupTask
instancejava.io.IOException
- When it is unable to open a file reference to the job directory@Bean @ConditionalOnProperty(value="genie.tasks.user-metrics.enabled", havingValue="true") @ConditionalOnMissingBean(value=UserMetricsTask.class) public UserMetricsTask userMetricsTask(io.micrometer.core.instrument.MeterRegistry registry, JobSearchService jobSearchService, UserMetricsProperties userMetricsProperties)
UserMetricsTask
instance for use.registry
- The metrics registryjobSearchService
- The job search serviceuserMetricsProperties
- The propertiesUserMetricsTask
instance@Bean @ConditionalOnProperty(value="genie.tasks.agent-cleanup.enabled", havingValue="true") @ConditionalOnMissingBean(value=AgentJobCleanupTask.class) public AgentJobCleanupTask agentJobCleanupTask(JobSearchService jobSearchService, JobPersistenceService jobPersistenceService, AgentCleanupProperties agentCleanupProperties, io.micrometer.core.instrument.MeterRegistry registry)
AgentJobCleanupTask
instance for use.jobSearchService
- The job search servicejobPersistenceService
- the job persistence serviceagentCleanupProperties
- the agent cleanup propertiesregistry
- the metrics registryAgentJobCleanupTask