@Validated public class JobResolverServiceImpl extends java.lang.Object implements JobResolverService
Constructor and Description |
---|
JobResolverServiceImpl(ApplicationPersistenceService applicationPersistenceService,
ClusterPersistenceService clusterPersistenceService,
CommandPersistenceService commandPersistenceService,
JobPersistenceService jobPersistenceService,
@NotEmpty java.util.List<ClusterLoadBalancer> clusterLoadBalancerImpls,
io.micrometer.core.instrument.MeterRegistry registry,
JobsProperties jobsProperties)
Constructor.
|
Modifier and Type | Method and 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.
|
public JobResolverServiceImpl(ApplicationPersistenceService applicationPersistenceService, ClusterPersistenceService clusterPersistenceService, CommandPersistenceService commandPersistenceService, JobPersistenceService jobPersistenceService, @NotEmpty @NotEmpty java.util.List<ClusterLoadBalancer> clusterLoadBalancerImpls, io.micrometer.core.instrument.MeterRegistry registry, JobsProperties jobsProperties)
applicationPersistenceService
- The ApplicationPersistenceService
to use to manipulate applicationsclusterPersistenceService
- The ClusterPersistenceService
to use to manipulate clusterscommandPersistenceService
- The CommandPersistenceService
to use to manipulate commandsjobPersistenceService
- The JobPersistenceService
instance to useclusterLoadBalancerImpls
- The ClusterLoadBalancer
implementations to useregistry
- The MeterRegistry
metrics repository to usejobsProperties
- The properties for running a job set by the user@Nonnull @Transactional public ResolvedJob resolveJob(java.lang.String id) throws GenieJobResolutionException
JobStatus.RESOLVED
.resolveJob
in interface JobResolverService
id
- The id of the job to resolve. The job must exist and its status must return true from
JobStatus#isResolvable()
ResolvedJob
instance containing all the concrete information needed to execute the jobGenieJobResolutionException
- When there is an issue resolving the job based on the information provided
by the user in conjunction with the configuration available in the system@Nonnull public ResolvedJob resolveJob(java.lang.String id, @Valid @Valid JobRequest jobRequest, boolean apiJob) throws GenieJobResolutionException
resolveJob
in interface JobResolverService
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.ResolvedJob
instanceGenieJobResolutionException
- When there is an issue resolving the job based on the information provided
by the user in conjunction with the configuration available in the system