public class LocalJobKillServiceImpl extends java.lang.Object implements JobKillService
Constructor and Description |
---|
LocalJobKillServiceImpl(java.lang.String hostName,
JobSearchService jobSearchService,
org.apache.commons.exec.Executor executor,
boolean runAsUser,
org.springframework.context.ApplicationEventPublisher eventPublisher,
org.springframework.core.io.Resource genieWorkingDir,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
killJob(java.lang.String id,
java.lang.String reason)
Kill the job with the given id if possible.
|
void |
onKillJobEvent(KillJobEvent event)
Listen for job kill events from within the system as opposed to on calls from users directly to killJob.
|
public LocalJobKillServiceImpl(@NotBlank java.lang.String hostName, @NotNull JobSearchService jobSearchService, @NotNull org.apache.commons.exec.Executor executor, boolean runAsUser, @NotNull org.springframework.context.ApplicationEventPublisher eventPublisher, @NotNull org.springframework.core.io.Resource genieWorkingDir, @NotNull com.fasterxml.jackson.databind.ObjectMapper objectMapper)
hostName
- The name of the host this Genie node is running onjobSearchService
- The job search service to use to locate job informationexecutor
- The executor to use to run system processesrunAsUser
- True if jobs are run as the user who submitted the jobeventPublisher
- The system event publisher to usegenieWorkingDir
- The working directory where all job directories are created.objectMapper
- The Jackson ObjectMapper used to serialize from/to JSONpublic void killJob(@NotBlank(message="No id entered. Unable to kill job.") java.lang.String id, @NotBlank(message="No reason provided.") java.lang.String reason) throws GenieException
killJob
in interface JobKillService
id
- id of job to killreason
- brief reason for requesting the job be killedGenieException
- if there is an error@EventListener public void onKillJobEvent(@NotNull KillJobEvent event) throws GenieException
onKillJobEvent
in interface JobKillService
event
- The KillJobEvent
GenieException
- On error