public class JobCoordinatorServiceImpl extends java.lang.Object implements JobCoordinatorService
Constructor and Description |
---|
JobCoordinatorServiceImpl(@NotNull JobPersistenceService jobPersistenceService,
@NotNull JobKillService jobKillService,
@NotNull JobStateService jobStateService,
@NotNull JobsProperties jobsProperties,
@NotNull ApplicationPersistenceService applicationPersistenceService,
@NotNull JobSearchService jobSearchService,
@NotNull ClusterPersistenceService clusterPersistenceService,
@NotNull CommandPersistenceService commandPersistenceService,
@NotNull JobResolverService jobResolverService,
@NotNull io.micrometer.core.instrument.MeterRegistry registry,
@NotBlank java.lang.String hostname)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
coordinateJob(@Valid @NotNull(message="No job request provided. Unable to execute.") JobRequest jobRequest,
@Valid @NotNull(message="No job metadata provided. Unable to execute.") JobMetadata jobMetadata)
Takes in a Job Request object and does necessary preparation for execution.
|
void |
killJob(@NotBlank java.lang.String jobId,
@NotBlank java.lang.String reason)
Kill the job identified by the given id.
|
public JobCoordinatorServiceImpl(@NotNull @NotNull JobPersistenceService jobPersistenceService, @NotNull @NotNull JobKillService jobKillService, @NotNull @NotNull JobStateService jobStateService, @NotNull @NotNull JobsProperties jobsProperties, @NotNull @NotNull ApplicationPersistenceService applicationPersistenceService, @NotNull @NotNull JobSearchService jobSearchService, @NotNull @NotNull ClusterPersistenceService clusterPersistenceService, @NotNull @NotNull CommandPersistenceService commandPersistenceService, @NotNull @NotNull JobResolverService jobResolverService, @NotNull @NotNull io.micrometer.core.instrument.MeterRegistry registry, @NotBlank @NotBlank java.lang.String hostname)
jobPersistenceService
- implementation of job persistence service interfacejobKillService
- The job kill service to usejobStateService
- The service where we report the job state and keep track of
various metrics about jobs currently runningjobsProperties
- The jobs properties to useapplicationPersistenceService
- Implementation of application service interfacejobSearchService
- Implementation of job search serviceclusterPersistenceService
- Implementation of cluster service interfacecommandPersistenceService
- Implementation of command service interfacejobResolverService
- The job specification service to useregistry
- The registryhostname
- The name of the host this Genie instance is running onpublic java.lang.String coordinateJob(@Valid @NotNull(message="No job request provided. Unable to execute.") @Valid @NotNull(message="No job request provided. Unable to execute.") JobRequest jobRequest, @Valid @NotNull(message="No job metadata provided. Unable to execute.") @Valid @NotNull(message="No job metadata provided. Unable to execute.") JobMetadata jobMetadata) throws GenieException
coordinateJob
in interface JobCoordinatorService
jobRequest
- of job to killjobMetadata
- Metadata about the http request which generated started this job processGenieException
- if there is an errorpublic void killJob(@NotBlank @NotBlank java.lang.String jobId, @NotBlank @NotBlank java.lang.String reason) throws GenieException
killJob
in interface JobCoordinatorService
jobId
- id of the job to killreason
- brief reason for requesting the job be killedGenieException
- if there is an error