Interface JobSetupService
public interface JobSetupService
Service that sets up a directory for a job to execute in.
The setup is broken into 3 stages so that they can be interleaved with other actions.
1. Create the empty folder structure
2. Download dependencies and other files in place
3. Evaluate setup scripts and create the job environment.
This service also performs cleanup of said job directory.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanupJobDirectory
(Path jobDirectory, CleanupStrategy cleanupStrategy) Performs post-execution cleanup of the job directory.createJobDirectory
(JobSpecification jobSpecification) Creates a directory for the given job.createJobScript
(JobSpecification jobSpecification, File jobDirectory) Creates the executable script that executes setup and runs the job (a.k.a.downloadJobResources
(JobSpecification jobSpecification, File jobDirectory) Downloads and stages all the job files (dependencies, configurations, ...) into the job directory.
-
Method Details
-
createJobDirectory
Creates a directory for the given job. Also creates the sub-directories structure common to all jobs.- Parameters:
jobSpecification
- the job specification- Returns:
- the job folder just created
- Throws:
SetUpJobException
- if the folder (or sub-folders) could not be created or already existed
-
downloadJobResources
Set<File> downloadJobResources(JobSpecification jobSpecification, File jobDirectory) throws SetUpJobException Downloads and stages all the job files (dependencies, configurations, ...) into the job directory.- Parameters:
jobSpecification
- the job specificationjobDirectory
- the job folder- Returns:
- the list of setup files staged
- Throws:
SetUpJobException
- TODO
-
createJobScript
Creates the executable script that executes setup and runs the job (a.k.a. run file).- Parameters:
jobSpecification
- the job specificationjobDirectory
- the job directory- Returns:
- the generated executable script file
- Throws:
SetUpJobException
- if the file cannot be created
-
cleanupJobDirectory
Performs post-execution cleanup of the job directory.- Parameters:
jobDirectory
- the job directory pathcleanupStrategy
- the cleanup strategy- Throws:
IOException
- TODO
-