@Validated
public interface AgentJobService
| Modifier and Type | Method and Description |
|---|---|
void |
claimJob(@NotBlank java.lang.String id,
@Valid com.netflix.genie.common.external.dtos.v4.AgentClientMetadata agentClientMetadata)
Set a job identified by
id to be owned by the agent identified by agentClientMetadata. |
com.netflix.genie.common.external.dtos.v4.JobSpecification |
dryRunJobSpecificationResolution(@Valid com.netflix.genie.common.external.dtos.v4.JobRequest jobRequest)
Run the job specification resolution algorithm on the given input but save nothing in the system.
|
java.util.Map<java.lang.String,java.lang.String> |
getAgentProperties(@Valid com.netflix.genie.common.external.dtos.v4.AgentClientMetadata agentMetadata)
Provide configuration properties for an agent that is beginning to execute a job.
|
com.netflix.genie.common.external.dtos.v4.JobSpecification |
getJobSpecification(@NotBlank java.lang.String id)
Get a job specification if has been resolved.
|
com.netflix.genie.common.external.dtos.v4.JobStatus |
getJobStatus(@NotBlank java.lang.String id)
Retrieve the status of the job identified with
id. |
void |
handshake(@Valid com.netflix.genie.common.external.dtos.v4.AgentClientMetadata agentMetadata)
Shake hands and allow a client or reject it based on the supplied
AgentClientMetadata. |
java.lang.String |
reserveJobId(@Valid com.netflix.genie.common.external.dtos.v4.JobRequest jobRequest,
@Valid com.netflix.genie.common.external.dtos.v4.AgentClientMetadata agentClientMetadata)
Reserve a job id and persist job details in the database based on the supplied
JobRequest. |
com.netflix.genie.common.external.dtos.v4.JobSpecification |
resolveJobSpecification(@NotBlank java.lang.String id)
Resolve the job specification for job identified by the given id.
|
void |
updateJobArchiveStatus(@NotBlank java.lang.String id,
com.netflix.genie.common.external.dtos.v4.ArchiveStatus newArchiveStatus)
Update the archive status status of the job identified with
id to be newStatus. |
void |
updateJobStatus(@NotBlank java.lang.String id,
com.netflix.genie.common.external.dtos.v4.JobStatus currentStatus,
com.netflix.genie.common.external.dtos.v4.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 handshake(@Valid
@Valid com.netflix.genie.common.external.dtos.v4.AgentClientMetadata agentMetadata)
AgentClientMetadata.agentMetadata - The metadata about the agent starting to run a given jobcom.netflix.genie.common.internal.exceptions.unchecked.GenieAgentRejectedException - If the server rejects the client based on its metadatajavax.validation.ConstraintViolationException - If the arguments fail validationjava.util.Map<java.lang.String,java.lang.String> getAgentProperties(@Valid
@Valid com.netflix.genie.common.external.dtos.v4.AgentClientMetadata agentMetadata)
agentMetadata - The metadata about the agent starting to run a given jobjavax.validation.ConstraintViolationException - If the arguments fail validationjava.lang.String reserveJobId(@Valid
@Valid com.netflix.genie.common.external.dtos.v4.JobRequest jobRequest,
@Valid
@Valid com.netflix.genie.common.external.dtos.v4.AgentClientMetadata agentClientMetadata)
JobRequest.jobRequest - The job request containing all the metadata needed to reserve a job idagentClientMetadata - The metadata about the agent driving this job requestcom.netflix.genie.common.internal.exceptions.unchecked.GenieIdAlreadyExistsException - If the id requested along with the job request is already in usejavax.validation.ConstraintViolationException - If the arguments fail validationcom.netflix.genie.common.external.dtos.v4.JobSpecification resolveJobSpecification(@NotBlank
@NotBlank java.lang.String id)
throws com.netflix.genie.common.internal.exceptions.checked.GenieJobResolutionException,
com.netflix.genie.common.internal.exceptions.unchecked.GenieJobResolutionRuntimeException
id - The id of the job to resolve the specification for. Must already have a reserved an id in the databasecom.netflix.genie.common.internal.exceptions.checked.GenieJobResolutionException - On error resolving the job given the input parameters and system statejavax.validation.ConstraintViolationException - If the arguments fail validationcom.netflix.genie.common.internal.exceptions.unchecked.GenieJobResolutionRuntimeException - If job resolution fails due to a runtime error (as opposed to
unsatisfiable constraints)com.netflix.genie.common.external.dtos.v4.JobSpecification getJobSpecification(@NotBlank
@NotBlank java.lang.String id)
id - the id of the job to retrieve the specification forcom.netflix.genie.common.internal.exceptions.unchecked.GenieJobNotFoundException - If the job has not yet had its ID reserved and/or can't be foundcom.netflix.genie.common.internal.exceptions.unchecked.GenieJobSpecificationNotFoundException - If the job exists but the specification hasn't been
resolved or saved yetjavax.validation.ConstraintViolationException - If the arguments fail validationcom.netflix.genie.common.external.dtos.v4.JobSpecification dryRunJobSpecificationResolution(@Valid
@Valid com.netflix.genie.common.external.dtos.v4.JobRequest jobRequest)
throws com.netflix.genie.common.internal.exceptions.checked.GenieJobResolutionException
jobRequest - The job request containing all the metadata needed to resolve a job specificationcom.netflix.genie.common.internal.exceptions.checked.GenieJobResolutionException - On error resolving the job given the input parameters and system statejavax.validation.ConstraintViolationException - If the arguments fail validationvoid claimJob(@NotBlank
@NotBlank java.lang.String id,
@Valid
@Valid com.netflix.genie.common.external.dtos.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.RESOLVEDjavax.validation.ConstraintViolationException - If the arguments fail validationvoid updateJobStatus(@NotBlank
@NotBlank java.lang.String id,
com.netflix.genie.common.external.dtos.v4.JobStatus currentStatus,
com.netflix.genie.common.external.dtos.v4.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.javax.validation.ConstraintViolationException - If the arguments fail validationcom.netflix.genie.common.external.dtos.v4.JobStatus getJobStatus(@NotBlank
@NotBlank java.lang.String id)
id.id - The id of the job to look up.com.netflix.genie.common.internal.exceptions.unchecked.GenieJobNotFoundException - if no job with the given id existsjavax.validation.ConstraintViolationException - If the arguments fail validationvoid updateJobArchiveStatus(@NotBlank
@NotBlank java.lang.String id,
com.netflix.genie.common.external.dtos.v4.ArchiveStatus newArchiveStatus)
id to be newStatus.
Notice this is a 'blind write', the currently persisted value will always be overwritten.id - The id of the job to update status for. Must exist in the system.newArchiveStatus - The new archive status the caller would like to update the status tocom.netflix.genie.common.internal.exceptions.unchecked.GenieJobNotFoundException - if no job with the given id existsjavax.validation.ConstraintViolationException - If the arguments fail validation