@Configuration @EnableConfigurationProperties(value={LocalAgentLauncherProperties.class,TitusAgentLauncherProperties.class}) @AutoConfigureAfter(value=org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration.class) public class AgentLaunchersAutoConfiguration extends java.lang.Object
Constructor and Description |
---|
AgentLaunchersAutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
LocalAgentLauncherImpl |
localAgentLauncher(GenieWebHostInfo genieWebHostInfo,
GenieWebRpcInfo genieWebRpcInfo,
DataServices dataServices,
LocalAgentLauncherProperties launcherProperties,
ExecutorFactory executorFactory,
BraveTracingComponents tracingComponents,
io.micrometer.core.instrument.MeterRegistry registry)
Provide a
AgentLauncher implementation which launches local agent processes if enabled via property. |
ExecutorFactory |
processExecutorFactory()
Provide an
ExecutorFactory instance if no other was defined. |
TitusAgentLauncherImpl |
titusAgentLauncher(org.springframework.web.client.RestTemplate restTemplate,
org.springframework.retry.support.RetryTemplate retryTemplate,
TitusAgentLauncherImpl.TitusJobRequestAdapter titusJobRequestAdapter,
GenieHostInfo genieHostInfo,
TitusAgentLauncherProperties titusAgentLauncherProperties,
BraveTracingComponents tracingComponents,
org.springframework.core.env.Environment environment,
io.micrometer.core.instrument.MeterRegistry registry)
Provide a
TitusAgentLauncherImpl implementation which launches agent processes in a dedicated Titus
container if enabled via property. |
org.springframework.retry.backoff.ExponentialBackOffPolicy |
titusAPIBackoffPolicy()
Provides a default implementation of
BackOffPolicy if no other has
been defined in the context. |
TitusAgentLauncherImpl.TitusAPIRetryPolicy |
titusAPIRetryPolicy()
Provides a default implementation of
RetryPolicy that retries based on a set
of HTTP status codes. |
org.springframework.retry.support.RetryTemplate |
titusAPIRetryTemplate(org.springframework.retry.RetryPolicy retryPolicy,
org.springframework.retry.backoff.BackOffPolicy backOffPolicy)
Provides a default implementation of
RetryTemplate that will be used to retry failed Titus api calls
based on the retry policy and backoff policies defined in the application context. |
TitusAgentLauncherImpl.TitusJobRequestAdapter |
titusJobRequestAdapter()
Provides a default implementation of
TitusAgentLauncherImpl.TitusJobRequestAdapter that is a no-op
if no other implementation has been provided elsewhere. |
org.springframework.web.client.RestTemplate |
titusRestTemplate(org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder)
Provide a
RestTemplate instance used for calling the Titus REST API if no other instance is provided. |
@Bean @ConditionalOnProperty(name="genie.agent.launcher.titus.enabled", havingValue="true") @ConditionalOnMissingBean(name="titusRestTemplate") public org.springframework.web.client.RestTemplate titusRestTemplate(org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder)
RestTemplate
instance used for calling the Titus REST API if no other instance is provided.restTemplateBuilder
- The Spring RestTemplateBuilder
instance to use@Bean @ConditionalOnProperty(name="genie.agent.launcher.titus.enabled", havingValue="true") @ConditionalOnMissingBean(value=TitusAgentLauncherImpl.TitusJobRequestAdapter.class) public TitusAgentLauncherImpl.TitusJobRequestAdapter titusJobRequestAdapter()
TitusAgentLauncherImpl.TitusJobRequestAdapter
that is a no-op
if no other implementation has been provided elsewhere.@Bean @ConditionalOnProperty(name="genie.agent.launcher.titus.enabled", havingValue="true") @ConditionalOnMissingBean(name="titusAPIRetryPolicy", value=org.springframework.retry.RetryPolicy.class) public TitusAgentLauncherImpl.TitusAPIRetryPolicy titusAPIRetryPolicy()
RetryPolicy
that retries based on a set
of HTTP status codes. Currently just HttpStatus.SERVICE_UNAVAILABLE
and
HttpStatus.REQUEST_TIMEOUT
. Max retries set to 3.TitusAgentLauncherImpl.TitusAPIRetryPolicy
instance with the default settings applied@Bean @ConditionalOnProperty(name="genie.agent.launcher.titus.enabled", havingValue="true") @ConditionalOnMissingBean(name="titusAPIBackoffPolicy", value=org.springframework.retry.backoff.BackOffPolicy.class) public org.springframework.retry.backoff.ExponentialBackOffPolicy titusAPIBackoffPolicy()
BackOffPolicy
if no other has
been defined in the context.ExponentialBackOffPolicy
instance@Bean @ConditionalOnProperty(name="genie.agent.launcher.titus.enabled", havingValue="true") @ConditionalOnMissingBean(name="titusAPIRetryTemplate", value=org.springframework.retry.support.RetryTemplate.class) public org.springframework.retry.support.RetryTemplate titusAPIRetryTemplate(@Qualifier(value="titusAPIRetryPolicy") org.springframework.retry.RetryPolicy retryPolicy, @Qualifier(value="titusAPIBackoffPolicy") org.springframework.retry.backoff.BackOffPolicy backOffPolicy)
RetryTemplate
that will be used to retry failed Titus api calls
based on the retry policy and backoff policies defined in the application context.retryPolicy
- The RetryPolicy
to use for Titus API call failuresbackOffPolicy
- The BackOffPolicy
to use for Titus API call failuresRetryTemplate
instance configured with the supplied retry and backoff policies@Bean @ConditionalOnProperty(name="genie.agent.launcher.titus.enabled", havingValue="true") public TitusAgentLauncherImpl titusAgentLauncher(@Qualifier(value="titusRestTemplate") org.springframework.web.client.RestTemplate restTemplate, @Qualifier(value="titusAPIRetryTemplate") org.springframework.retry.support.RetryTemplate retryTemplate, TitusAgentLauncherImpl.TitusJobRequestAdapter titusJobRequestAdapter, GenieHostInfo genieHostInfo, TitusAgentLauncherProperties titusAgentLauncherProperties, BraveTracingComponents tracingComponents, org.springframework.core.env.Environment environment, io.micrometer.core.instrument.MeterRegistry registry)
TitusAgentLauncherImpl
implementation which launches agent processes in a dedicated Titus
container if enabled via property.restTemplate
- the rest templateretryTemplate
- The RetryTemplate
instance to use to retry failed Titus API callstitusJobRequestAdapter
- The TitusAgentLauncherImpl.TitusJobRequestAdapter
implementation to
usegenieHostInfo
- the metadata about the local server and hosttitusAgentLauncherProperties
- the configuration propertiestracingComponents
- The BraveTracingComponents
instance to useenvironment
- The application Environment
used to pull dynamic properties after
launchregistry
- the metric registryTitusAgentLauncherImpl
@Bean @ConditionalOnMissingBean(value=ExecutorFactory.class) public ExecutorFactory processExecutorFactory()
ExecutorFactory
instance if no other was defined.ExecutorFactory
@Bean @ConditionalOnProperty(name="genie.agent.launcher.local.enabled", havingValue="true") public LocalAgentLauncherImpl localAgentLauncher(GenieWebHostInfo genieWebHostInfo, GenieWebRpcInfo genieWebRpcInfo, DataServices dataServices, LocalAgentLauncherProperties launcherProperties, ExecutorFactory executorFactory, BraveTracingComponents tracingComponents, io.micrometer.core.instrument.MeterRegistry registry)
AgentLauncher
implementation which launches local agent processes if enabled via property.genieWebHostInfo
- The GenieWebHostInfo
of this instancegenieWebRpcInfo
- The GenieWebRpcInfo
of this instancedataServices
- The DataServices
instance to uselauncherProperties
- The properties related to launching an agent locallyexecutorFactory
- The ExecutorFactory
to use to launch agent processestracingComponents
- The BraveTracingComponents
instance to useregistry
- The MeterRegistry
to register metricsLocalAgentLauncherImpl
instance