@Validated
public interface JobPersistenceService
| Modifier and Type | Method and Description |
|---|---|
void |
claimJob(@NotBlank(message="Job id is missing and is required") java.lang.String id,
@Valid com.netflix.genie.common.internal.dto.v4.AgentClientMetadata agentClientMetadata)
Set a job identified by
id to be owned by the agent identified by agentClientMetadata. |
void |
createJob(com.netflix.genie.common.dto.JobRequest jobRequest,
com.netflix.genie.common.dto.JobMetadata jobMetadata,
@NotNull com.netflix.genie.common.dto.Job job,
@NotNull com.netflix.genie.common.dto.JobExecution jobExecution)
Save all the initial job fields in the data store.
|
long |
deleteBatchOfJobsCreatedBeforeDate(@NotNull java.time.Instant date,
@Min(value=1L) int maxDeleted,
@Min(value=1L) int pageSize)
This method will delete a chunk of jobs whose creation time is earlier than the given date.
|
java.util.Optional<java.lang.String> |
getJobArchiveLocation(@NotBlank(message="Job id is missing and is required") java.lang.String id)
Get the location a job directory was archived to if at all.
|
java.util.Optional<com.netflix.genie.common.internal.dto.v4.JobRequest> |
getJobRequest(@NotBlank(message="Id is missing and is required") java.lang.String id)
Get the original request for a job.
|
java.util.Optional<com.netflix.genie.common.internal.dto.v4.JobSpecification> |
getJobSpecification(@NotBlank(message="Id is missing and is required") java.lang.String id)
Get the saved job specification for the given job.
|
com.netflix.genie.common.dto.JobStatus |
getJobStatus(@NotBlank(message="Job id is missing and is required") java.lang.String id)
Get the status for a job with the given
id. |
boolean |
isV4(@NotBlank(message="Id is missing and is required") java.lang.String id)
Get whether the job is a v4 job.
|
java.lang.String |
saveJobRequest(@Valid com.netflix.genie.common.internal.dto.v4.JobRequest jobRequest,
@Valid com.netflix.genie.common.internal.dto.v4.JobRequestMetadata jobRequestMetadata)
Save the job request information.
|
void |
saveJobSpecification(@NotBlank(message="Id is missing and is required") java.lang.String id,
@Valid com.netflix.genie.common.internal.dto.v4.JobSpecification specification)
Save the given job specification details for a job.
|
void |
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") com.netflix.genie.common.dto.JobStatus status,
@NotBlank(message="Status message can\'t be blank. Unable to update") 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(@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.time.Instant timeout)
Update the job with information for the running job process.
|
void |
updateJobStatus(@NotBlank(message="Id is missing and is required") java.lang.String id,
@NotNull com.netflix.genie.common.dto.JobStatus currentStatus,
@NotNull com.netflix.genie.common.dto.JobStatus newStatus,
java.lang.String newStatusMessage)
Update the status of the job identified with
id to be newStatus provided that the current status
of the job matches newStatus. |
void |
updateJobStatus(@NotBlank(message="No job id entered. Unable to update.") java.lang.String id,
@NotNull(message="Status cannot be null.") com.netflix.genie.common.dto.JobStatus jobStatus,
@NotBlank(message="Status message cannot be empty.") java.lang.String statusMsg)
Update the status and status message of the job.
|
void |
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)
Update the job with the various resources used to run the job including the cluster, command and applications.
|
void createJob(@NotNull
com.netflix.genie.common.dto.JobRequest jobRequest,
@NotNull
com.netflix.genie.common.dto.JobMetadata jobMetadata,
@NotNull
@NotNull com.netflix.genie.common.dto.Job job,
@NotNull
@NotNull com.netflix.genie.common.dto.JobExecution jobExecution)
throws com.netflix.genie.common.exceptions.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 createcom.netflix.genie.common.exceptions.GenieException - if there is an errorvoid updateJobWithRuntimeEnvironment(@NotBlank
@NotBlank java.lang.String jobId,
@NotBlank
@NotBlank java.lang.String clusterId,
@NotBlank
@NotBlank java.lang.String commandId,
@NotNull
@NotNull java.util.List<java.lang.String> applicationIds,
@Min(value=1L)
@Min(value=1L) int memory)
throws com.netflix.genie.common.exceptions.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 withcom.netflix.genie.common.exceptions.GenieException - For any problems while updatingvoid updateJobStatus(@NotBlank(message="No job id entered. Unable to update.")
@NotBlank(message="No job id entered. Unable to update.") java.lang.String id,
@NotNull(message="Status cannot be null.")
@NotNull(message="Status cannot be null.") com.netflix.genie.common.dto.JobStatus jobStatus,
@NotBlank(message="Status message cannot be empty.")
@NotBlank(message="Status message cannot be empty.") java.lang.String statusMsg)
throws com.netflix.genie.common.exceptions.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.com.netflix.genie.common.exceptions.GenieException - if there is an errorvoid setJobRunningInformation(@NotBlank
@NotBlank java.lang.String id,
@Min(value=0L,message="Must be no lower than zero")
@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")
@Min(value=1L,message="Must be at least 1 millisecond, preferably much more") long checkDelay,
@NotNull
@NotNull java.time.Instant timeout)
throws com.netflix.genie.common.exceptions.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 timeoutcom.netflix.genie.common.exceptions.GenieException - if there is an errorvoid setJobCompletionInformation(@NotBlank(message="No job id entered. Unable to update.")
@NotBlank(message="No job id entered. Unable to update.") java.lang.String id,
int exitCode,
@NotNull(message="No job status entered. Unable to update")
@NotNull(message="No job status entered. Unable to update") com.netflix.genie.common.dto.JobStatus status,
@NotBlank(message="Status message can\'t be blank. Unable to update")
@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 com.netflix.genie.common.exceptions.GenieException
id - the id of the job to update the exit codeexitCode - The exit code of the processstatus - The job status for the jobstatusMessage - The 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 onecom.netflix.genie.common.exceptions.GenieException - if there is an errorlong deleteBatchOfJobsCreatedBeforeDate(@NotNull
@NotNull java.time.Instant date,
@Min(value=1L)
@Min(value=1L) int maxDeleted,
@Min(value=1L)
@Min(value=1L) int pageSize)
date - The date before which all jobs should be deletedmaxDeleted - The maximum number of jobs that should be deleted
(soft limit, can be rounded up to multiple of page size)pageSize - Page size used to iterate through jobsjava.lang.String saveJobRequest(@Valid
@Valid com.netflix.genie.common.internal.dto.v4.JobRequest jobRequest,
@Valid
@Valid com.netflix.genie.common.internal.dto.v4.JobRequestMetadata jobRequestMetadata)
jobRequest - All the metadata provided by the user about the jobjobRequestMetadata - Metadata about the request gathered by the system not provided by the usercom.netflix.genie.common.internal.exceptions.unchecked.GenieIdAlreadyExistsException - When the requested ID is already in usecom.netflix.genie.common.internal.exceptions.unchecked.GenieRuntimeException - On other type of errorjava.util.Optional<com.netflix.genie.common.internal.dto.v4.JobRequest> getJobRequest(@NotBlank(message="Id is missing and is required")
@NotBlank(message="Id is missing and is required") java.lang.String id)
id - The unique id of the job to getOptional so empty optional returned if no job foundcom.netflix.genie.common.internal.exceptions.unchecked.GenieRuntimeException - On error converting entity values to DTO valuesvoid saveJobSpecification(@NotBlank(message="Id is missing and is required")
@NotBlank(message="Id is missing and is required") java.lang.String id,
@Valid
@Valid com.netflix.genie.common.internal.dto.v4.JobSpecification specification)
JobStatus.RESOLVED.id - The id of the jobspecification - The job specificationcom.netflix.genie.common.internal.exceptions.unchecked.GenieJobNotFoundException - When the job identified by id can't be found and the
specification can't be savedcom.netflix.genie.common.internal.exceptions.unchecked.GenieClusterNotFoundException - When the cluster specified in the job specification doesn't actually
existcom.netflix.genie.common.internal.exceptions.unchecked.GenieCommandNotFoundException - When the command specified in the job specification doesn't actually
existcom.netflix.genie.common.internal.exceptions.unchecked.GenieApplicationNotFoundException - When an application specified in the job specification doesn't
actually existjava.util.Optional<com.netflix.genie.common.internal.dto.v4.JobSpecification> getJobSpecification(@NotBlank(message="Id is missing and is required")
@NotBlank(message="Id is missing and is required") java.lang.String id)
Optional will be returned.id - The id of the jobOptionalcom.netflix.genie.common.internal.exceptions.unchecked.GenieJobNotFoundException - If no job with id existscom.netflix.genie.common.internal.exceptions.unchecked.GenieClusterNotFoundException - When the cluster isn't found in the database which it should be at this
point given the input to the db was valid at the time of persistencecom.netflix.genie.common.internal.exceptions.unchecked.GenieCommandNotFoundException - When the command isn't found in the database which it should be at this
point given the input to the db was valid at the time of persistencecom.netflix.genie.common.internal.exceptions.unchecked.GenieRuntimeException - on unexpected errorvoid claimJob(@NotBlank(message="Job id is missing and is required")
@NotBlank(message="Job id is missing and is required") java.lang.String id,
@Valid
@Valid com.netflix.genie.common.internal.dto.v4.AgentClientMetadata agentClientMetadata)
id to be owned by the agent identified by agentClientMetadata. The
job status in the system will be set to JobStatus.CLAIMEDid - The id of the job to claim. Must exist in the system.agentClientMetadata - The metadata about the client claiming the jobcom.netflix.genie.common.internal.exceptions.unchecked.GenieJobNotFoundException - if no job with the given id existscom.netflix.genie.common.internal.exceptions.unchecked.GenieJobAlreadyClaimedException - if the job with the given id already has been claimedcom.netflix.genie.common.internal.exceptions.unchecked.GenieInvalidStatusException - if the current job status is not
JobStatus.RESOLVEDvoid updateJobStatus(@NotBlank(message="Id is missing and is required")
@NotBlank(message="Id is missing and is required") java.lang.String id,
@NotNull
@NotNull com.netflix.genie.common.dto.JobStatus currentStatus,
@NotNull
@NotNull com.netflix.genie.common.dto.JobStatus newStatus,
@Nullable
java.lang.String newStatusMessage)
id to be newStatus provided that the current status
of the job matches newStatus. Optionally a status message can be provided to provide more details to
users. If the newStatus is JobStatus.RUNNING the start time will be set. If the newStatus
is a member of JobStatus.getFinishedStatuses() and the job had a started time set the finished time of
the job will be set.id - The id of the job to update status for. Must exist in the system.currentStatus - The status the caller to this API thinks the job currently hasnewStatus - The new status the caller would like to update the status tonewStatusMessage - An optional status message to associate with this changecom.netflix.genie.common.internal.exceptions.unchecked.GenieJobNotFoundException - if no job with the given id existscom.netflix.genie.common.internal.exceptions.unchecked.GenieInvalidStatusException - if the current status of the job identified by id in the system
doesn't match the supplied currentStatus.
Also if the currentStatus equals the newStatus.boolean isV4(@NotBlank(message="Id is missing and is required")
@NotBlank(message="Id is missing and is required") java.lang.String id)
id - The id of the jobcom.netflix.genie.common.internal.exceptions.unchecked.GenieJobNotFoundException - If no job with id existscom.netflix.genie.common.dto.JobStatus getJobStatus(@NotBlank(message="Job id is missing and is required")
@NotBlank(message="Job id is missing and is required") java.lang.String id)
throws com.netflix.genie.common.exceptions.GenieNotFoundException
id.id - The id of the job to get status forcom.netflix.genie.common.exceptions.GenieNotFoundException - If no job with the given id existsjava.util.Optional<java.lang.String> getJobArchiveLocation(@NotBlank(message="Job id is missing and is required")
@NotBlank(message="Job id is missing and is required") java.lang.String id)
throws com.netflix.genie.common.exceptions.GenieNotFoundException
id - The id of the job to get the location forOptional.empty()com.netflix.genie.common.exceptions.GenieNotFoundException - When there is no job with id id