Modifier and Type | Field and Description |
---|---|
protected hudson.model.AbstractBuild<?,?> |
build |
protected String |
COMMUNICATION_FILE |
protected com.michelin.cio.hudson.plugins.copytoslave.CopyToMasterNotifier |
copyFileToMaster |
protected hudson.Launcher |
launcher |
protected hudson.model.BuildListener |
listener |
protected String |
masterWorkingDirectory |
Constructor and Description |
---|
BatchSystem(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener,
String COMMUNICATION_FILE,
String masterWorkingDirectory) |
Modifier and Type | Method and Description |
---|---|
abstract void |
cleanUpFiles(String jobId)
cleans up the files created by the batch system
|
abstract void |
createFinishedJobOutputFile(String jobId,
int offset)
creates the final job output file of the finished job in the slave
|
abstract void |
createFormattedRunningJobOutputFile(String outputFileName,
int offset,
int numberOfLines)
creates a formatted job output file of the running job in the slave from
the specified output file (created by createJobProgressFile method)
|
abstract void |
createJobProgressFile(String jobId,
String outputFileName)
creates the job output file of the running job in the slave
|
abstract String |
getJobStatus(String jobId) |
abstract boolean |
isEndStatus(String jobStatus) |
abstract boolean |
isRunningStatus(String jobStatus) |
abstract boolean |
jobCompletedSuccessfully(String jobStatus) |
abstract boolean |
jobExitedWithErrors(String jobStatus) |
abstract void |
killJob(String jobId)
kills the job with specified job id in the batch system
|
abstract void |
printErrorLog()
prints the error log to the slave console
|
abstract void |
printExitCode(String jobId)
prints the exit code to the slave console
|
abstract void |
processStatus(String jobStatus)
executes the appropriate actions depending on the status of the job
(prints the appropriate messages)
|
abstract String |
submitJob(String jobFileName,
boolean sendEmail,
String queueType)
submits the the job to the batch system's selected queue and configures
if an email should be sent after the job is done
|
protected final hudson.model.AbstractBuild<?,?> build
protected final hudson.Launcher launcher
protected final hudson.model.BuildListener listener
protected final String COMMUNICATION_FILE
protected final com.michelin.cio.hudson.plugins.copytoslave.CopyToMasterNotifier copyFileToMaster
protected final String masterWorkingDirectory
public abstract String submitJob(String jobFileName, boolean sendEmail, String queueType) throws InterruptedException, IOException
jobFileName
- name of the job filesendEmail
- specifies if an email should be sentqueueType
- the batch system's queue type (if it has one)InterruptedException
IOException
public abstract String getJobStatus(String jobId) throws IOException, InterruptedException
jobId
- IOException
InterruptedException
public abstract void killJob(String jobId) throws InterruptedException
jobId
- the identifier of the jobInterruptedException
public abstract void processStatus(String jobStatus)
jobStatus
- the status of the jobpublic abstract void printErrorLog() throws InterruptedException
InterruptedException
public abstract void printExitCode(String jobId) throws InterruptedException, IOException
jobId
- the identifier of the jobInterruptedException
IOException
public abstract void createJobProgressFile(String jobId, String outputFileName) throws InterruptedException, IOException
jobId
- the identifier of the joboutputFileName
- name of the created output fileInterruptedException
IOException
public abstract void createFormattedRunningJobOutputFile(String outputFileName, int offset, int numberOfLines) throws InterruptedException, IOException
outputFileName
- the output file that should be formattedoffset
- number of lines that should be skipped from the given
output filenumberOfLines
- the total amount of lines of the given output fileInterruptedException
IOException
public abstract void createFinishedJobOutputFile(String jobId, int offset) throws InterruptedException
jobId
- the identifier of the joboffset
- number of lines that should be skipped from the final
outputInterruptedException
public abstract void cleanUpFiles(String jobId) throws InterruptedException
jobId
- InterruptedException
public abstract boolean isRunningStatus(String jobStatus)
jobStatus
- the status of the jobpublic abstract boolean isEndStatus(String jobStatus)
jobStatus
- the status of the jobpublic abstract boolean jobExitedWithErrors(String jobStatus)
jobStatus
- the status of the jobpublic abstract boolean jobCompletedSuccessfully(String jobStatus)
jobStatus
- the status of the jobCopyright © 2004-2015. All Rights Reserved.