Hold, release, suspend, resume, or kill the job identified by jobId. If jobId is JOB_IDS_SESSION_ALL
, then this routine acts on all jobs submitted during this DRMAA session up to the moment control() is called. To avoid thread races conditions in multithreaded applications, the DRMAA implementation user should explicitly synchronize this call with any other job submission or control calls that may change the number of remote jobs.
The legal values for action and their meanings are:
SUSPEND
: stop the job, RESUME
: (re)start the job, HOLD
: put the job on-hold, RELEASE
: release the hold on the job, and TERMINATE
: kill the job.
This method returns once the action has been acknowledged by the DRM system, but it does not necessarily wait until the action has been completed.
Some DRMAA implementations may allow this method to be used to control jobs submitted external to the DRMAA session, such as jobs submitted by other DRMAA sessions or jobs submitted via native utilities.
If jobId is JOB_IDS_SESSION_ALL
and the control action fails for one or more jobs, and InternalException will be thrown, and the state of the jobs in the session will be undefined.
@param jobId The id of the job to control
@param action the control action to be taken
@throws DrmaaException May be one of the following:
- ResumeInconsistentStateException -- an attempt was made to resume a job that was not is a suspended state
- SuspendInconsistentStateException -- an attempt was made to suspend a job that was not is a running state
- HoldInconsistentStateException -- an attempt was made to hold a job that was not is a pending state
- ReleaseInconsistentStateException -- an attempt was made to release a job that was not is a held state
- InvalidJobException -- the job identifier does not refer to an active job
- NoActiveSessionException -- the session has not yet been initialized or has already been exited
- DrmCommunicationException -- the DRMAA implementation was unable to contact the DRM
- AuthorizationException -- the executing user does not have sufficient permissions to execute the desired action
- IllegalArgumentException -- an argument is invalid
- InternalException -- an error has occured in the DRMAA implementation