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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarchivedJobService(DataServices dataServices, org.springframework.core.io.ResourceLoader resourceLoader, io.micrometer.core.instrument.MeterRegistry meterRegistry) Provide aArchivedJobServiceimplementation 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 ofJobDirectoryServerServicefor serving job directory resources.jobLaunchService(DataServices dataServices, JobResolverService jobResolverService, AgentLauncherSelector agentLauncherSelector, BraveTracingComponents tracingComponents, io.micrometer.core.instrument.MeterRegistry registry) Provide aJobLaunchServiceimplementation if one isn't available.jobResolutionProperties(org.springframework.core.env.Environment environment) Provide a bean forJobResolutionPropertieswhich 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 ofJobResolverServiceif 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 ofRequestForwardingServicefor 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 forJobResolutionPropertieswhich encapsulates defaults and other values set by external configuration related to job resolution.- Parameters:
environment- The applicationEnvironment- Returns:
- A
JobResolutionPropertiesinstance 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
JobsPropertiesinstance
-
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 ofJobResolverServiceif one hasn't already been defined.- Parameters:
dataServices- TheDataServicesencapsulation instance to useclusterSelectors- TheClusterSelectorimplementations to usecommandSelector- TheCommandSelectorimplementation to useregistry- The metrics repository to usejobsProperties- The properties for running a job set by the userjobResolutionProperties- TheJobResolutionPropertiesinstancetracingComponents- TheBraveTracingComponentsto use- Returns:
- A
JobResolverServiceImplinstance
-
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 ofJobDirectoryServerServicefor serving job directory resources.- Parameters:
resourceLoader- The application resource loader used to get references to resourcesdataServices- TheDataServicesinstance to useagentFileStreamService- The service to request a file from an agent running a jobarchivedJobService- TheArchivedJobServiceimplementation 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 aJobLaunchServiceimplementation if one isn't available.- Parameters:
dataServices- TheDataServicesinstance to usejobResolverService- TheJobResolverServiceimplementation to useagentLauncherSelector- TheAgentLauncherSelectorimplementation to usetracingComponents- TheBraveTracingComponentsinstance to useregistry- The metrics registry to use- Returns:
- A
JobLaunchServiceImplinstance
-
archivedJobService
@Bean @ConditionalOnMissingBean(ArchivedJobService.class) public ArchivedJobServiceImpl archivedJobService(DataServices dataServices, org.springframework.core.io.ResourceLoader resourceLoader, io.micrometer.core.instrument.MeterRegistry meterRegistry) Provide aArchivedJobServiceimplementation if one hasn't been provided already.- Parameters:
dataServices- TheDataServicesinstance to useresourceLoader- TheResourceLoaderto usemeterRegistry- TheMeterRegistryimplementation to use- Returns:
- A
ArchivedJobServiceImplinstance
-
requestForwardingService
@Bean @ConditionalOnMissingBean(RequestForwardingService.class) public RequestForwardingServiceImpl requestForwardingService(@Qualifier("genieRestTemplate") org.springframework.web.client.RestTemplate genieRestTemplate, GenieHostInfo hostInfo, JobsForwardingProperties jobsForwardingProperties) Provide a default implementation ofRequestForwardingServicefor use by other services.- Parameters:
genieRestTemplate- TheRestTemplateconfigured to be used to call other Genie nodeshostInfo- TheGenieHostInfoinstance containing introspection information about the current nodejobsForwardingProperties- The properties for forwarding requests between Genie nodes- Returns:
- A
RequestForwardingServiceImplinstance
-