Class TitusAgentLauncherImpl
java.lang.Object
com.netflix.genie.web.agent.launchers.impl.TitusAgentLauncherImpl
- All Implemented Interfaces:
AgentLauncher,org.springframework.boot.actuate.health.HealthContributor,org.springframework.boot.actuate.health.HealthIndicator
Agent launcher that spawns a job in a dedicated container through Titus.
- Since:
- 4.0.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA retry policy that has different behavior based on the type of exception thrown by the rest client during calls to the Titus API.static interfaceAn interface that should be implemented by any class which wants to modify the Titus job request before it is sent. -
Field Summary
Fields inherited from interface com.netflix.genie.web.agent.launchers.AgentLauncher
LAUNCH_TIMER, LAUNCHER_CLASS_EXT_FIELD, LAUNCHER_CLASS_KEY, SOURCE_HOST_EXT_FIELD -
Constructor Summary
ConstructorsConstructorDescriptionTitusAgentLauncherImpl(org.springframework.web.client.RestTemplate restTemplate, org.springframework.retry.support.RetryTemplate retryTemplate, TitusAgentLauncherImpl.TitusJobRequestAdapter jobRequestAdapter, com.github.benmanes.caffeine.cache.Cache<String, String> healthIndicatorCache, GenieHostInfo genieHostInfo, TitusAgentLauncherProperties titusAgentLauncherProperties, BraveTracingComponents tracingComponents, org.springframework.core.env.Environment environment, io.micrometer.core.instrument.MeterRegistry registry) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.actuate.health.Healthhealth()Optional<com.fasterxml.jackson.databind.JsonNode>launchAgent(ResolvedJob resolvedJob, com.fasterxml.jackson.databind.JsonNode requestedLauncherExt) Launch an agent to execute the givenResolvedJobinformation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.actuate.health.HealthIndicator
getHealth
-
Constructor Details
-
TitusAgentLauncherImpl
public TitusAgentLauncherImpl(org.springframework.web.client.RestTemplate restTemplate, org.springframework.retry.support.RetryTemplate retryTemplate, TitusAgentLauncherImpl.TitusJobRequestAdapter jobRequestAdapter, com.github.benmanes.caffeine.cache.Cache<String, String> healthIndicatorCache, GenieHostInfo genieHostInfo, TitusAgentLauncherProperties titusAgentLauncherProperties, BraveTracingComponents tracingComponents, org.springframework.core.env.Environment environment, io.micrometer.core.instrument.MeterRegistry registry) Constructor.- Parameters:
restTemplate- the rest templateretryTemplate- TheRetryTemplateto use when making Titus API callsjobRequestAdapter- The implementation ofTitusAgentLauncherImpl.TitusJobRequestAdapterto usehealthIndicatorCache- a cache to store metadata about recently launched jobsgenieHostInfo- the metadata about the local server and hosttitusAgentLauncherProperties- the configuration propertiestracingComponents- TheBraveTracingComponentsinstance to use for distributed tracingenvironment- The application environment to pull dynamic properties fromregistry- the metric registry
-
-
Method Details
-
launchAgent
public Optional<com.fasterxml.jackson.databind.JsonNode> launchAgent(ResolvedJob resolvedJob, @Nullable com.fasterxml.jackson.databind.JsonNode requestedLauncherExt) throws AgentLaunchException Launch an agent to execute the givenResolvedJobinformation.- Specified by:
launchAgentin interfaceAgentLauncher- Parameters:
resolvedJob- TheResolvedJobinformation for the agent to act onrequestedLauncherExt- The launcher requested extension, or null- Returns:
- an optional
JsonNodewith the launcher context about the launched job - Throws:
AgentLaunchException- For any error launching an Agent instance to run the job
-
health
public org.springframework.boot.actuate.health.Health health()- Specified by:
healthin interfaceorg.springframework.boot.actuate.health.HealthIndicator
-