@Validated
public interface JobPersistenceService
| Modifier and Type | Method and Description |
|---|---|
void |
createJob(JobRequest jobRequest,
JobMetadata jobMetadata,
Job job,
JobExecution jobExecution)
Save all the initial job fields in the data store.
|
long |
deleteAllJobsCreatedBeforeDate(java.util.Date date)
This method will delete all jobs whose created time is less than date.
|
void |
setJobCompletionInformation(java.lang.String id,
int exitCode,
JobStatus status,
java.lang.String statusMessage,
java.lang.Long stdOutSize,
java.lang.Long stdErrSize)
Method to set all job completion information for a job execution.
|
void |
setJobRunningInformation(java.lang.String id,
int processId,
long checkDelay,
java.util.Date timeout)
Update the job with information for the running job process.
|
void |
updateJobStatus(java.lang.String id,
JobStatus jobStatus,
java.lang.String statusMsg)
Update the status and status message of the job.
|
void |
updateJobWithRuntimeEnvironment(java.lang.String jobId,
java.lang.String clusterId,
java.lang.String commandId,
java.util.List<java.lang.String> applicationIds,
int memory)
Update the job with the various resources used to run the job including the cluster, command and applications.
|
void createJob(@NotNull
JobRequest jobRequest,
@NotNull
JobMetadata jobMetadata,
@NotNull
Job job,
@NotNull
JobExecution jobExecution)
throws GenieException
jobRequest - the Job request object to save. Not nulljobMetadata - metadata about the job request. Not nulljob - The Job object to createjobExecution - The job execution object to createGenieException - if there is an errorvoid updateJobWithRuntimeEnvironment(@NotBlank
java.lang.String jobId,
@NotBlank
java.lang.String clusterId,
@NotBlank
java.lang.String commandId,
@NotNull
java.util.List<java.lang.String> applicationIds,
@Min(value=1L)
int memory)
throws GenieException
jobId - The id of the job to updateclusterId - The id of the cluster the job runs oncommandId - The id of the command the job runs withapplicationIds - The ids of the applications used to run the jobmemory - The amount of memory (in MB) to run the job withGenieException - For any problems while updatingvoid updateJobStatus(@NotBlank(message="No job id entered. Unable to update.")
java.lang.String id,
@NotNull(message="Status cannot be null.")
JobStatus jobStatus,
@NotBlank(message="Status message cannot be empty.")
java.lang.String statusMsg)
throws GenieException
id - The id of the job to update the status for.jobStatus - The updated status of the job.statusMsg - The updated status message of the job.GenieException - if there is an errorvoid setJobRunningInformation(@NotBlank
java.lang.String id,
@Min(value=0L,message="Must be no lower than zero")
int processId,
@Min(value=1L,message="Must be at least 1 millisecond, preferably much more")
long checkDelay,
@NotNull
java.util.Date timeout)
throws GenieException
id - the id of the job to update the process id forprocessId - The id of the process on the box for this jobcheckDelay - The delay to check the process withtimeout - The date at which this job should timeoutGenieException - if there is an errorvoid setJobCompletionInformation(@NotBlank(message="No job id entered. Unable to update.")
java.lang.String id,
int exitCode,
@NotNull(message="No job status entered. Unable to update")
JobStatus status,
@NotBlank(message="Status message can\'t be blank. Unable to update")
java.lang.String statusMessage,
@Nullable
java.lang.Long stdOutSize,
@Nullable
java.lang.Long stdErrSize)
throws GenieException
id - the id of the job to update the exit codeexitCode - The exit code of the processstatus - The final job status for the jobstatusMessage - The final job status messagestdOutSize - The size (in bytes) of the standard out file or null if there isn't onestdErrSize - The size (in bytes) of the standard error file or null if there isn't oneGenieException - if there is an errorlong deleteAllJobsCreatedBeforeDate(@NotNull
java.util.Date date)
date - The date before which all jobs should be deleted