Class NodeAutoConfiguration


  • @Configuration
    @EnableConfigurationProperties(DiskCleanupProperties.class)
    public class NodeAutoConfiguration
    extends java.lang.Object
    Auto configuration for tasks that run on every Genie server node.
    Since:
    4.0.0
    • Constructor Detail

      • NodeAutoConfiguration

        public NodeAutoConfiguration()
    • Method Detail

      • diskCleanupTask

        @Bean
        @ConditionalOnProperty(value="genie.tasks.disk-cleanup.enabled",
                               havingValue="true")
        @ConditionalOnMissingBean(DiskCleanupTask.class)
        public DiskCleanupTask diskCleanupTask​(DiskCleanupProperties properties,
                                               @Qualifier("genieTaskScheduler")
                                               org.springframework.scheduling.TaskScheduler scheduler,
                                               @Qualifier("jobsDir")
                                               org.springframework.core.io.Resource jobsDir,
                                               DataServices dataServices,
                                               JobsProperties jobsProperties,
                                               org.apache.commons.exec.Executor processExecutor,
                                               io.micrometer.core.instrument.MeterRegistry registry)
                                        throws java.io.IOException
        If required get a DiskCleanupTask instance for use.
        Parameters:
        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 directory
        dataServices - The DataServices instance to use
        jobsProperties - The jobs properties to use
        processExecutor - The process executor to use to delete directories
        registry - The metrics registry
        Returns:
        The DiskCleanupTask instance
        Throws:
        java.io.IOException - When it is unable to open a file reference to the job directory