Class ServicesAutoConfiguration
java.lang.Object
com.netflix.genie.web.spring.autoconfigure.services.ServicesAutoConfiguration
@Configuration
@EnableConfigurationProperties({JobsForwardingProperties.class,JobsLocationsProperties.class,JobsMemoryProperties.class,JobsUsersProperties.class,JobsActiveLimitProperties.class,AttachmentServiceProperties.class})
public class ServicesAutoConfiguration
extends Object
Configuration for all the services.
- Since:
- 3.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionarchivedJobService
(DataServices dataServices, org.springframework.core.io.ResourceLoader resourceLoader, io.micrometer.core.instrument.MeterRegistry meterRegistry) Provide aArchivedJobService
implementation if one hasn't been provided already.attachmentService
(S3ClientFactory s3ClientFactory, AttachmentServiceProperties attachmentServiceProperties, io.micrometer.core.instrument.MeterRegistry meterRegistry) The attachment service to use.jobDirectoryServerService
(org.springframework.core.io.ResourceLoader resourceLoader, DataServices dataServices, AgentFileStreamService agentFileStreamService, ArchivedJobService archivedJobService, io.micrometer.core.instrument.MeterRegistry meterRegistry, AgentRoutingService agentRoutingService) Provide the default implementation ofJobDirectoryServerService
for serving job directory resources.jobLaunchService
(DataServices dataServices, JobResolverService jobResolverService, AgentLauncherSelector agentLauncherSelector, BraveTracingComponents tracingComponents, io.micrometer.core.instrument.MeterRegistry registry) Provide aJobLaunchService
implementation if one isn't available.jobResolutionProperties
(org.springframework.core.env.Environment environment) Provide a bean forJobResolutionProperties
which encapsulates defaults and other values set by external configuration related to job resolution.jobResolverService
(DataServices dataServices, @NotEmpty List<ClusterSelector> clusterSelectors, CommandSelector commandSelector, io.micrometer.core.instrument.MeterRegistry registry, JobsProperties jobsProperties, JobResolutionProperties jobResolutionProperties, BraveTracingComponents tracingComponents) Get an implementation ofJobResolverService
if one hasn't already been defined.jobsProperties
(JobsForwardingProperties forwarding, JobsLocationsProperties locations, JobsMemoryProperties memory, JobsUsersProperties users, JobsActiveLimitProperties activeLimit) Collection of properties related to job execution.requestForwardingService
(org.springframework.web.client.RestTemplate genieRestTemplate, GenieHostInfo hostInfo, JobsForwardingProperties jobsForwardingProperties) Provide a default implementation ofRequestForwardingService
for use by other services.
-
Constructor Details
-
ServicesAutoConfiguration
public ServicesAutoConfiguration()
-
-
Method Details
-
jobResolutionProperties
@Bean public JobResolutionProperties jobResolutionProperties(org.springframework.core.env.Environment environment) Provide a bean forJobResolutionProperties
which encapsulates defaults and other values set by external configuration related to job resolution.- Parameters:
environment
- The applicationEnvironment
- Returns:
- A
JobResolutionProperties
instance which will refresh itself in the background
-
jobsProperties
@Bean public JobsProperties jobsProperties(JobsForwardingProperties forwarding, JobsLocationsProperties locations, JobsMemoryProperties memory, JobsUsersProperties users, JobsActiveLimitProperties activeLimit) Collection of properties related to job execution.- Parameters:
forwarding
- forwarding propertieslocations
- locations propertiesmemory
- memory propertiesusers
- users propertiesactiveLimit
- active limit properties- Returns:
- a
JobsProperties
instance
-
attachmentService
@Bean @ConditionalOnMissingBean(AttachmentService.class) public AttachmentService attachmentService(S3ClientFactory s3ClientFactory, AttachmentServiceProperties attachmentServiceProperties, io.micrometer.core.instrument.MeterRegistry meterRegistry) throws IOException The attachment service to use.- Parameters:
s3ClientFactory
- the S3 client factoryattachmentServiceProperties
- the service propertiesmeterRegistry
- the meter registry- Returns:
- The attachment service to use
- Throws:
IOException
- if the local filesystem implmentation is used and it fails to initialize
-
jobResolverService
@Bean @ConditionalOnMissingBean(JobResolverService.class) public JobResolverServiceImpl jobResolverService(DataServices dataServices, @NotEmpty @NotEmpty List<ClusterSelector> clusterSelectors, CommandSelector commandSelector, io.micrometer.core.instrument.MeterRegistry registry, JobsProperties jobsProperties, JobResolutionProperties jobResolutionProperties, BraveTracingComponents tracingComponents) Get an implementation ofJobResolverService
if one hasn't already been defined.- Parameters:
dataServices
- TheDataServices
encapsulation instance to useclusterSelectors
- TheClusterSelector
implementations to usecommandSelector
- TheCommandSelector
implementation to useregistry
- The metrics repository to usejobsProperties
- The properties for running a job set by the userjobResolutionProperties
- TheJobResolutionProperties
instancetracingComponents
- TheBraveTracingComponents
to use- Returns:
- A
JobResolverServiceImpl
instance
-
jobDirectoryServerService
@Bean @ConditionalOnMissingBean(JobDirectoryServerService.class) public JobDirectoryServerServiceImpl jobDirectoryServerService(org.springframework.core.io.ResourceLoader resourceLoader, DataServices dataServices, AgentFileStreamService agentFileStreamService, ArchivedJobService archivedJobService, io.micrometer.core.instrument.MeterRegistry meterRegistry, AgentRoutingService agentRoutingService) Provide the default implementation ofJobDirectoryServerService
for serving job directory resources.- Parameters:
resourceLoader
- The application resource loader used to get references to resourcesdataServices
- TheDataServices
instance to useagentFileStreamService
- The service to request a file from an agent running a jobarchivedJobService
- TheArchivedJobService
implementation to use to get archived job datameterRegistry
- The meter registry used to keep track of metricsagentRoutingService
- The agent routing service- Returns:
- An instance of
JobDirectoryServerServiceImpl
-
jobLaunchService
@Bean @ConditionalOnMissingBean(JobLaunchService.class) public JobLaunchServiceImpl jobLaunchService(DataServices dataServices, JobResolverService jobResolverService, AgentLauncherSelector agentLauncherSelector, BraveTracingComponents tracingComponents, io.micrometer.core.instrument.MeterRegistry registry) Provide aJobLaunchService
implementation if one isn't available.- Parameters:
dataServices
- TheDataServices
instance to usejobResolverService
- TheJobResolverService
implementation to useagentLauncherSelector
- TheAgentLauncherSelector
implementation to usetracingComponents
- TheBraveTracingComponents
instance to useregistry
- The metrics registry to use- Returns:
- A
JobLaunchServiceImpl
instance
-
archivedJobService
@Bean @ConditionalOnMissingBean(ArchivedJobService.class) public ArchivedJobServiceImpl archivedJobService(DataServices dataServices, org.springframework.core.io.ResourceLoader resourceLoader, io.micrometer.core.instrument.MeterRegistry meterRegistry) Provide aArchivedJobService
implementation if one hasn't been provided already.- Parameters:
dataServices
- TheDataServices
instance to useresourceLoader
- TheResourceLoader
to usemeterRegistry
- TheMeterRegistry
implementation to use- Returns:
- A
ArchivedJobServiceImpl
instance
-
requestForwardingService
@Bean @ConditionalOnMissingBean(RequestForwardingService.class) public RequestForwardingServiceImpl requestForwardingService(@Qualifier("genieRestTemplate") org.springframework.web.client.RestTemplate genieRestTemplate, GenieHostInfo hostInfo, JobsForwardingProperties jobsForwardingProperties) Provide a default implementation ofRequestForwardingService
for use by other services.- Parameters:
genieRestTemplate
- TheRestTemplate
configured to be used to call other Genie nodeshostInfo
- TheGenieHostInfo
instance containing introspection information about the current nodejobsForwardingProperties
- The properties for forwarding requests between Genie nodes- Returns:
- A
RequestForwardingServiceImpl
instance
-