Class JobProcessManagerImpl
java.lang.Object
com.netflix.genie.agent.execution.process.impl.JobProcessManagerImpl
- All Implemented Interfaces:
JobProcessManager
Configures and launches a job sub-process using metadata passed through ExecutionContext.
- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionJobProcessManagerImpl
(org.springframework.scheduling.TaskScheduler taskScheduler, BraveTracingComponents tracingComponents) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
kill
(KillService.KillSource source) Terminate job process execution (if still running) or prevent it from launching (if not launched yet).void
launchProcess
(File jobDirectory, File jobScript, boolean interactive, Integer timeout, boolean launchInJobDirectory) Launch the job process (unless launch was aborted by previous akill
call).waitFor()
Wait indefinitely for the job process to terminate.
-
Constructor Details
-
JobProcessManagerImpl
public JobProcessManagerImpl(org.springframework.scheduling.TaskScheduler taskScheduler, BraveTracingComponents tracingComponents) Constructor.- Parameters:
taskScheduler
- TheTaskScheduler
instance to use to run scheduled asynchronous taskstracingComponents
- TheBraveTracingComponents
instance to use for propagating trace information
-
-
Method Details
-
launchProcess
public void launchProcess(File jobDirectory, File jobScript, boolean interactive, @Nullable Integer timeout, boolean launchInJobDirectory) throws JobLaunchException Launch the job process (unless launch was aborted by previous akill
call).- Specified by:
launchProcess
in interfaceJobProcessManager
- Parameters:
jobDirectory
- Job directoryjobScript
- job script (a.k.a. run file)interactive
- launch in interactive mode (inherit I/O) or batch (no input, write outputs to files)timeout
- The optional number of seconds this job is allowed to run before the system will kill itlaunchInJobDirectory
- launch the job process from the job directory rather than the current directory- Throws:
JobLaunchException
- if the job process failed to launch
-
kill
Terminate job process execution (if still running) or prevent it from launching (if not launched yet). Optionally sends SIGINT to the process (unnecessary under certain circumstances. For example, CTRL-C in a terminal session, is already received by the job process, issuing a second one is unneeded).- Specified by:
kill
in interfaceJobProcessManager
- Parameters:
source
- TheKillService.KillSource
value representing where this kill request is coming from
-
waitFor
Wait indefinitely for the job process to terminate.- Specified by:
waitFor
in interfaceJobProcessManager
- Returns:
- KILLED, SUCCESSFUL, or FAILED
- Throws:
InterruptedException
- if the calling thread is interrupted while waiting
-