Class JobResolverServiceImpl
- java.lang.Object
-
- com.netflix.genie.web.services.impl.JobResolverServiceImpl
-
- All Implemented Interfaces:
JobResolverService
@Validated public class JobResolverServiceImpl extends java.lang.Object implements JobResolverService
Implementation of theJobResolverService
APIs.- Since:
- 4.0.0
-
-
Constructor Summary
Constructors Constructor Description JobResolverServiceImpl(DataServices dataServices, @NotEmpty java.util.List<ClusterSelector> clusterSelectors, CommandSelector commandSelector, io.micrometer.core.instrument.MeterRegistry registry, JobsProperties jobsProperties, org.springframework.core.env.Environment environment, BraveTracingComponents tracingComponents)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResolvedJob
resolveJob(java.lang.String id)
Given the id of a job that was successfully submitted to the system this API will attempt to resolve all the concrete details (cluster, command, resources, etc) needed for the system to actually launch the job.ResolvedJob
resolveJob(java.lang.String id, @Valid JobRequest jobRequest, boolean apiJob)
Given a job request resolve all the details needed to run a job.
-
-
-
Constructor Detail
-
JobResolverServiceImpl
public JobResolverServiceImpl(DataServices dataServices, @NotEmpty @NotEmpty java.util.List<ClusterSelector> clusterSelectors, CommandSelector commandSelector, io.micrometer.core.instrument.MeterRegistry registry, JobsProperties jobsProperties, org.springframework.core.env.Environment environment, BraveTracingComponents tracingComponents)
Constructor.- Parameters:
dataServices
- TheDataServices
encapsulation instance to useclusterSelectors
- TheClusterSelector
implementations to usecommandSelector
- TheCommandSelector
implementation to useregistry
- TheMeterRegistry
metrics repository to usejobsProperties
- The properties for running a job set by the userenvironment
- The Spring applicationEnvironment
for dynamic property resolutiontracingComponents
- TheBraveTracingComponents
instance to use
-
-
Method Detail
-
resolveJob
@Nonnull @Transactional public ResolvedJob resolveJob(java.lang.String id) throws GenieJobResolutionException, GenieJobResolutionRuntimeException
Given the id of a job that was successfully submitted to the system this API will attempt to resolve all the concrete details (cluster, command, resources, etc) needed for the system to actually launch the job. Once these details are determined they are persisted and the job is marked asJobStatus.RESOLVED
.- Specified by:
resolveJob
in interfaceJobResolverService
- Parameters:
id
- The id of the job to resolve. The job must exist and its status must return true fromJobStatus
#isResolvable()- Returns:
- A
ResolvedJob
instance containing all the concrete information needed to execute the job - Throws:
GenieJobResolutionException
- When the job cannot resolved due to unsatisfiable constraintsGenieJobResolutionRuntimeException
- When the job fails to resolve due to a runtime error.
-
resolveJob
@Nonnull public ResolvedJob resolveJob(java.lang.String id, @Valid @Valid JobRequest jobRequest, boolean apiJob) throws GenieJobResolutionException, GenieJobResolutionRuntimeException
Given a job request resolve all the details needed to run a job. This API is stateless and saves nothing.- Specified by:
resolveJob
in interfaceJobResolverService
- Parameters:
id
- The id of the jobjobRequest
- The job request containing all details a user wants to have for their jobapiJob
- true if this job was submitted via the REST API. false otherwise.- Returns:
- The completely resolved job information within a
ResolvedJob
instance - Throws:
GenieJobResolutionException
- When the job cannot resolved due to unsatisfiable constraintsGenieJobResolutionRuntimeException
- When the job fails to resolve due to a runtime error.
-
-