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

public class TitusAgentLauncherImpl extends Object implements AgentLauncher
Agent launcher that spawns a job in a dedicated container through Titus.
Since:
4.0.0
See Also:
  • 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 template
      retryTemplate - The RetryTemplate to use when making Titus API calls
      jobRequestAdapter - The implementation of TitusAgentLauncherImpl.TitusJobRequestAdapter to use
      healthIndicatorCache - a cache to store metadata about recently launched jobs
      genieHostInfo - the metadata about the local server and host
      titusAgentLauncherProperties - the configuration properties
      tracingComponents - The BraveTracingComponents instance to use for distributed tracing
      environment - The application environment to pull dynamic properties from
      registry - 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 given ResolvedJob information.
      Specified by:
      launchAgent in interface AgentLauncher
      Parameters:
      resolvedJob - The ResolvedJob information for the agent to act on
      requestedLauncherExt - The launcher requested extension, or null
      Returns:
      an optional JsonNode with 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:
      health in interface org.springframework.boot.actuate.health.HealthIndicator