Class NMPIQueueManagerCompat
java.lang.Object
uk.ac.manchester.spinnaker.nmpi.nmpi.NMPIQueueManagerCompat
- All Implemented Interfaces:
NMPIQueueManager
Manages the NMPI queue, receiving jobs and submitting them to be run.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(NMPIQueueListener listener) Register a listener against the manager for new jobs.voidappendJobLog(int id, String logToAppend) Appends log messages to the log.voidclose()Close the manager.getJobs()Get jobs that are marked as running or in progress in some form.voidProcess responses from the queue now.voidsetJobError(int id, String logToAppend, List<DataItem> outputs, Throwable error, ObjectNode provenance) Marks a job as finished with an error.voidsetJobFinished(int id, String logToAppend, List<DataItem> outputs, ObjectNode provenance) Marks a job as finished successfully.voidsetJobRunning(int id) Mark a job as running.
-
Field Details
-
STATUS_FINISHED
Job status when finished.- See Also:
-
STATUS_VALIDATED
Job status when in the queue but the executer hasn't started.- See Also:
-
STATUS_RUNNING
Job status when running.- See Also:
-
STATUS_ERROR
Job status when in error.- See Also:
-
-
Constructor Details
-
NMPIQueueManagerCompat
public NMPIQueueManagerCompat()
-
-
Method Details
-
getJobs
Description copied from interface:NMPIQueueManagerGet jobs that are marked as running or in progress in some form.- Specified by:
getJobsin interfaceNMPIQueueManager- Returns:
- A list of jobs.
-
addListener
Register a listener against the manager for new jobs.- Specified by:
addListenerin interfaceNMPIQueueManager- Parameters:
listener- The listener to register
-
processResponsesFromQueue
public void processResponsesFromQueue()Description copied from interface:NMPIQueueManagerProcess responses from the queue now.- Specified by:
processResponsesFromQueuein interfaceNMPIQueueManager
-
appendJobLog
Appends log messages to the log.- Specified by:
appendJobLogin interfaceNMPIQueueManager- Parameters:
id- The ID of the joblogToAppend- The messages to append
-
setJobRunning
public void setJobRunning(int id) Mark a job as running.- Specified by:
setJobRunningin interfaceNMPIQueueManager- Parameters:
id- The ID of the job.
-
setJobFinished
public void setJobFinished(int id, String logToAppend, List<DataItem> outputs, ObjectNode provenance) Marks a job as finished successfully.- Specified by:
setJobFinishedin interfaceNMPIQueueManager- Parameters:
id- The ID of the joblogToAppend- Any additional log messages to append to the existing log (null if none)outputs- The outputs of the job (null if none)provenance- JSON provenance information
-
setJobError
public void setJobError(int id, String logToAppend, List<DataItem> outputs, Throwable error, ObjectNode provenance) Marks a job as finished with an error.- Specified by:
setJobErrorin interfaceNMPIQueueManager- Parameters:
id- The ID of the joblogToAppend- Any additional log messages to append to the existing log (null if none)outputs- Any outputs generated, or null if noneerror- The error detailsprovenance- JSON provenance information
-
close
public void close()Close the manager.- Specified by:
closein interfaceNMPIQueueManager
-