@Configuration @EnableConfigurationProperties(value={FileCacheProperties.class,JobsCleanupProperties.class,JobsForwardingProperties.class,JobsLocationsProperties.class,JobsMaxProperties.class,JobsMemoryProperties.class,JobsUsersProperties.class,ExponentialBackOffTriggerProperties.class,JobsActiveLimitProperties.class}) public class ServicesAutoConfiguration extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SCRIPT_LOAD_BALANCER_PRECEDENCE
The relative order of the
ScriptLoadBalancer if one is enabled relative to other
ClusterLoadBalancer instances that may be in the context. |
Constructor and Description |
---|
ServicesAutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
FileSystemAttachmentService |
attachmentService(JobsProperties jobsProperties)
The attachment service to use.
|
GenieFileTransferService |
cacheGenieFileTransferService(FileTransferFactory fileTransferFactory,
FileCacheProperties fileCacheProperties,
LocalFileTransferImpl localFileTransfer,
io.micrometer.core.instrument.MeterRegistry registry)
Get an instance of the Cache Genie File Transfer service.
|
org.springframework.beans.factory.config.ServiceLocatorFactoryBean |
fileTransferFactory()
FileTransfer factory.
|
GenieFileTransferService |
genieFileTransferService(FileTransferFactory fileTransferFactory)
Get an instance of the Genie File Transfer service.
|
JobCompletionService |
jobCompletionService(JobPersistenceService jobPersistenceService,
JobSearchService jobSearchService,
JobArchiveService jobArchiveService,
org.springframework.core.io.Resource genieWorkingDir,
MailService mailService,
io.micrometer.core.instrument.MeterRegistry registry,
JobsProperties jobsProperties,
org.springframework.retry.support.RetryTemplate retryTemplate)
Get an implementation of
JobCompletionService if one hasn't already been defined. |
JobCoordinatorService |
jobCoordinatorService(JobPersistenceService jobPersistenceService,
JobKillService jobKillService,
JobStateService jobStateService,
JobSearchService jobSearchService,
JobsProperties jobsProperties,
ApplicationPersistenceService applicationPersistenceService,
ClusterPersistenceService clusterPersistenceService,
CommandPersistenceService commandPersistenceService,
JobResolverService jobResolverService,
io.micrometer.core.instrument.MeterRegistry registry,
GenieHostInfo genieHostInfo)
Get an instance of the JobCoordinatorService.
|
JobDirectoryServerServiceImpl |
jobDirectoryServerService(org.springframework.core.io.ResourceLoader resourceLoader,
JobPersistenceService jobPersistenceService,
JobFileService jobFileService,
AgentFileStreamService agentFileStreamService,
io.micrometer.core.instrument.MeterRegistry meterRegistry,
JobDirectoryManifestService jobDirectoryManifestService)
Provide the default implementation of
JobDirectoryServerService for serving job directory resources. |
DiskJobFileServiceImpl |
jobFileService(org.springframework.core.io.Resource jobsDir)
Get a
JobFileService implementation if one is required. |
JobKillServiceImpl |
jobKillService(JobKillServiceV3 jobKillServiceV3,
JobKillServiceV4 jobKillServiceV4,
JobPersistenceService jobPersistenceService)
Get an local implementation of the JobKillService.
|
JobKillServiceV3 |
jobKillServiceV3(GenieHostInfo genieHostInfo,
JobSearchService jobSearchService,
org.apache.commons.exec.Executor executor,
JobsProperties jobsProperties,
GenieEventBus genieEventBus,
org.springframework.core.io.Resource genieWorkingDir,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
ProcessChecker.Factory processCheckerFactory)
Get an local implementation of the JobKillService.
|
JobLaunchServiceImpl |
jobLaunchService(JobPersistenceService jobPersistenceService,
JobResolverService jobResolverService,
AgentLauncher agentLauncher,
io.micrometer.core.instrument.MeterRegistry registry)
Provide a
JobLaunchService implementation if one isn't available. |
JobResolverServiceImpl |
jobResolverService(ApplicationPersistenceService applicationPersistenceService,
ClusterPersistenceService clusterPersistenceService,
CommandPersistenceService commandPersistenceService,
JobPersistenceService jobPersistenceService,
@NotEmpty java.util.List<ClusterLoadBalancer> clusterLoadBalancerImpls,
io.micrometer.core.instrument.MeterRegistry registry,
JobsProperties jobsProperties)
Get an implementation of
JobResolverService if one hasn't already been defined. |
JobsProperties |
jobsProperties(JobsCleanupProperties cleanup,
JobsForwardingProperties forwarding,
JobsLocationsProperties locations,
JobsMaxProperties max,
JobsMemoryProperties memory,
JobsUsersProperties users,
ExponentialBackOffTriggerProperties completionCheckBackOff,
JobsActiveLimitProperties activeLimit)
Collection of properties related to job execution.
|
JobSubmitterService |
jobSubmitterService(JobPersistenceService jobPersistenceService,
GenieEventBus genieEventBus,
java.util.List<WorkflowTask> workflowTasks,
org.springframework.core.io.Resource genieWorkingDir,
io.micrometer.core.instrument.MeterRegistry registry)
Get a implementation of the JobSubmitterService that runs jobs locally.
|
RandomizedClusterLoadBalancerImpl |
randomizedClusterLoadBalancer()
The default cluster load balancer if all others fail.
|
ScriptLoadBalancer |
scriptLoadBalancer(org.springframework.core.task.AsyncTaskExecutor asyncTaskExecutor,
org.springframework.scheduling.TaskScheduler taskScheduler,
GenieFileTransferService fileTransferService,
org.springframework.core.env.Environment environment,
com.fasterxml.jackson.databind.ObjectMapper mapper,
io.micrometer.core.instrument.MeterRegistry registry)
Produce the
ScriptLoadBalancer instance to use for this Genie node if it was configured by the user. |
public static final int SCRIPT_LOAD_BALANCER_PRECEDENCE
ScriptLoadBalancer
if one is enabled relative to other
ClusterLoadBalancer
instances that may be in the context. This allows users to fit 50 more
balancer's between the script load balancer and the default RandomizedClusterLoadBalancerImpl
. If
the user wants to place a balancer implementation before the script one they only need to subtract from this
value.@Bean public JobsProperties jobsProperties(JobsCleanupProperties cleanup, JobsForwardingProperties forwarding, JobsLocationsProperties locations, JobsMaxProperties max, JobsMemoryProperties memory, JobsUsersProperties users, ExponentialBackOffTriggerProperties completionCheckBackOff, JobsActiveLimitProperties activeLimit)
cleanup
- cleanup propertiesforwarding
- forwarding propertieslocations
- locations propertiesmax
- max propertiesmemory
- memory propertiesusers
- users propertiescompletionCheckBackOff
- completion back-off propertiesactiveLimit
- active limit propertiesJobsProperties
instance@Bean @ConditionalOnMissingBean(value=JobKillServiceV3.class) public JobKillServiceV3 jobKillServiceV3(GenieHostInfo genieHostInfo, JobSearchService jobSearchService, org.apache.commons.exec.Executor executor, JobsProperties jobsProperties, GenieEventBus genieEventBus, @Qualifier(value="jobsDir") org.springframework.core.io.Resource genieWorkingDir, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ProcessChecker.Factory processCheckerFactory)
genieHostInfo
- Information about the host the Genie process is running onjobSearchService
- The job search service to use to locate job information.executor
- The executor to use to run system processes.jobsProperties
- The jobs properties to usegenieEventBus
- The application event bus to use to publish system wide eventsgenieWorkingDir
- Working directory for genie where it creates jobs directories.objectMapper
- The Jackson ObjectMapper used to serialize from/to JSONprocessCheckerFactory
- The process checker factory@Bean @ConditionalOnMissingBean(value=JobKillService.class) public JobKillServiceImpl jobKillService(JobKillServiceV3 jobKillServiceV3, JobKillServiceV4 jobKillServiceV4, JobPersistenceService jobPersistenceService)
jobKillServiceV3
- Service to kill V3 jobs.jobKillServiceV4
- Service to kill V4 jobs.jobPersistenceService
- Job persistence service@Bean @ConditionalOnMissingBean(name="genieFileTransferService") public GenieFileTransferService genieFileTransferService(FileTransferFactory fileTransferFactory) throws GenieException
fileTransferFactory
- file transfer implementation factoryGenieException
- If there is any problem@Bean @ConditionalOnMissingBean(name="cacheGenieFileTransferService") public GenieFileTransferService cacheGenieFileTransferService(FileTransferFactory fileTransferFactory, FileCacheProperties fileCacheProperties, LocalFileTransferImpl localFileTransfer, io.micrometer.core.instrument.MeterRegistry registry) throws GenieException
fileTransferFactory
- file transfer implementation factoryfileCacheProperties
- Properties related to the file cache that can be set by the adminlocalFileTransfer
- local file transfer serviceregistry
- RegistryGenieException
- If there is any problem@Bean @ConditionalOnMissingBean(value=JobSubmitterService.class) public JobSubmitterService jobSubmitterService(JobPersistenceService jobPersistenceService, GenieEventBus genieEventBus, java.util.List<WorkflowTask> workflowTasks, @Qualifier(value="jobsDir") org.springframework.core.io.Resource genieWorkingDir, io.micrometer.core.instrument.MeterRegistry registry)
jobPersistenceService
- Implementation of the job persistence service.genieEventBus
- The genie event bus implementation to useworkflowTasks
- List of all the workflow tasks to be executed.genieWorkingDir
- Working directory for genie where it creates jobs directories.registry
- The metrics registry to use@Bean @ConditionalOnMissingBean(value=JobCoordinatorService.class) public JobCoordinatorService jobCoordinatorService(JobPersistenceService jobPersistenceService, JobKillService jobKillService, @Qualifier(value="jobMonitoringCoordinator") JobStateService jobStateService, JobSearchService jobSearchService, JobsProperties jobsProperties, ApplicationPersistenceService applicationPersistenceService, ClusterPersistenceService clusterPersistenceService, CommandPersistenceService commandPersistenceService, JobResolverService jobResolverService, io.micrometer.core.instrument.MeterRegistry registry, GenieHostInfo genieHostInfo)
jobPersistenceService
- implementation of job persistence service interfacejobKillService
- The job kill service to usejobStateService
- The running job metrics service to usejobSearchService
- Implementation of job search service interfacejobsProperties
- The jobs properties to useapplicationPersistenceService
- Implementation of application service interfaceclusterPersistenceService
- Implementation of cluster service interfacecommandPersistenceService
- Implementation of command service interfacejobResolverService
- The job specification service to useregistry
- The metrics registry to usegenieHostInfo
- Information about the host the Genie process is running on@Bean @ConditionalOnMissingBean(value=AttachmentService.class) public FileSystemAttachmentService attachmentService(JobsProperties jobsProperties)
jobsProperties
- All properties related to jobs@Bean @ConditionalOnMissingBean(name="fileTransferFactory", value=org.springframework.beans.factory.config.ServiceLocatorFactoryBean.class) public org.springframework.beans.factory.config.ServiceLocatorFactoryBean fileTransferFactory()
@Bean @ConditionalOnMissingBean(value=JobFileService.class) public DiskJobFileServiceImpl jobFileService(@Qualifier(value="jobsDir") org.springframework.core.io.Resource jobsDir) throws java.io.IOException
JobFileService
implementation if one is required.jobsDir
- The job directory resourceDiskJobFileServiceImpl
instancejava.io.IOException
- When the job directory can't be created or isn't a directory@Bean @ConditionalOnMissingBean(value=JobResolverService.class) public JobResolverServiceImpl jobResolverService(ApplicationPersistenceService applicationPersistenceService, ClusterPersistenceService clusterPersistenceService, CommandPersistenceService commandPersistenceService, JobPersistenceService jobPersistenceService, @NotEmpty @NotEmpty java.util.List<ClusterLoadBalancer> clusterLoadBalancerImpls, io.micrometer.core.instrument.MeterRegistry registry, JobsProperties jobsProperties)
JobResolverService
if one hasn't already been defined.applicationPersistenceService
- The service to use to manipulate applicationsclusterPersistenceService
- The service to use to manipulate clusterscommandPersistenceService
- The service to use to manipulate commandsjobPersistenceService
- The job persistence service instance to useclusterLoadBalancerImpls
- The load balancer implementations to useregistry
- The metrics repository to usejobsProperties
- The properties for running a job set by the userJobResolverServiceImpl
instance@Bean @ConditionalOnMissingBean(value=JobCompletionService.class) public JobCompletionService jobCompletionService(JobPersistenceService jobPersistenceService, JobSearchService jobSearchService, JobArchiveService jobArchiveService, @Qualifier(value="jobsDir") org.springframework.core.io.Resource genieWorkingDir, MailService mailService, io.micrometer.core.instrument.MeterRegistry registry, JobsProperties jobsProperties, @Qualifier(value="genieRetryTemplate") org.springframework.retry.support.RetryTemplate retryTemplate) throws GenieException
JobCompletionService
if one hasn't already been defined.jobPersistenceService
- The job persistence service to usejobSearchService
- The job search service to usejobArchiveService
- The JobArchiveService
implementation to usegenieWorkingDir
- Working directory for genie where it creates jobs directories.mailService
- The mail serviceregistry
- RegistryjobsProperties
- The jobs properties to useretryTemplate
- The retry templateJobCompletionService
GenieException
- if the bean fails during construction@Bean @ConditionalOnMissingBean(value=JobDirectoryServerService.class) public JobDirectoryServerServiceImpl jobDirectoryServerService(org.springframework.core.io.ResourceLoader resourceLoader, JobPersistenceService jobPersistenceService, JobFileService jobFileService, AgentFileStreamService agentFileStreamService, io.micrometer.core.instrument.MeterRegistry meterRegistry, JobDirectoryManifestService jobDirectoryManifestService)
JobDirectoryServerService
for serving job directory resources.resourceLoader
- The application resource loader used to get references to resourcesjobPersistenceService
- The job persistence service used to get information about a jobjobFileService
- The service responsible for managing the job working directory on disk for
V3 JobsagentFileStreamService
- The service to request a file from an agent running a jobmeterRegistry
- The meter registry used to keep track of metricsjobDirectoryManifestService
- The job directory manifest serviceJobDirectoryServerServiceImpl
@Bean @Order(value=2147483597) @ConditionalOnProperty(value="genie.jobs.clusters.load-balancers.script.enabled", havingValue="true") public ScriptLoadBalancer scriptLoadBalancer(@Qualifier(value="genieAsyncTaskExecutor") org.springframework.core.task.AsyncTaskExecutor asyncTaskExecutor, @Qualifier(value="genieTaskScheduler") org.springframework.scheduling.TaskScheduler taskScheduler, @Qualifier(value="cacheGenieFileTransferService") GenieFileTransferService fileTransferService, org.springframework.core.env.Environment environment, com.fasterxml.jackson.databind.ObjectMapper mapper, io.micrometer.core.instrument.MeterRegistry registry)
ScriptLoadBalancer
instance to use for this Genie node if it was configured by the user.asyncTaskExecutor
- The asynchronous task executor to usetaskScheduler
- The task scheduler to usefileTransferService
- The file transfer service to useenvironment
- The program environment from Springmapper
- The JSON object mapper to useregistry
- The meter registry for capturing metricsScriptLoadBalancer
if one enabled@Bean @Order public RandomizedClusterLoadBalancerImpl randomizedClusterLoadBalancer()
Defaults to Ordered.LOWEST_PRECEDENCE
.
RandomizedClusterLoadBalancerImpl
instance@Bean @ConditionalOnMissingBean(value=JobLaunchService.class) public JobLaunchServiceImpl jobLaunchService(JobPersistenceService jobPersistenceService, JobResolverService jobResolverService, AgentLauncher agentLauncher, io.micrometer.core.instrument.MeterRegistry registry)
JobLaunchService
implementation if one isn't available.jobPersistenceService
- The JobPersistenceService
implementation to usejobResolverService
- The JobResolverService
implementation to useagentLauncher
- The AgentLauncher
implementation to useregistry
- The metrics registry to useJobLaunchServiceImpl
instance