public class JobCoordinatorServiceImpl extends java.lang.Object implements JobCoordinatorService
Constructor and Description |
---|
JobCoordinatorServiceImpl(@NotNull DataServices dataServices,
@NotNull JobKillService jobKillService,
@NotNull JobStateService jobStateService,
@NotNull JobsProperties jobsProperties,
@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 DataServices dataServices, @NotNull @NotNull JobKillService jobKillService, @NotNull @NotNull JobStateService jobStateService, @NotNull @NotNull JobsProperties jobsProperties, @NotNull @NotNull JobResolverService jobResolverService, @NotNull @NotNull io.micrometer.core.instrument.MeterRegistry registry, @NotBlank @NotBlank java.lang.String hostname)
dataServices
- The DataServices
encapsulation to usejobKillService
- 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 usejobResolverService
- 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