| | 1 | = Job Monitor = |
| | 2 | |
| | 3 | Job execution is monitored by reading a log file of the job. A job consists of a number of steps which consists of a number of operations ([http://www.molgenis.org/wiki/ComputeStartDataModel MCF Data Model]). A step of the job can be started when all operations of a previous step are finished. Operations in a step can be executed in parallel. Every operation writes to a job log file. Monitoring is implemented by reading job log files. Monitoring is called from [http://www.molgenis.org/svn/sandbox/molgenis_processing/3.3.galaxy/ScriptbasedComputePlatform/src/scriptserver/PipelineThread.java PipelineThread] after step is submitted for execution: |
| | 4 | |
| | 5 | {{{ |
| | 6 | int numberOfSteps = pipeline.getNumberOfSteps(); |
| | 7 | |
| | 8 | for (int i = 0; i < numberOfSteps; i++) |
| | 9 | { |
| | 10 | Step step = pipeline.getStep(i); |
| | 11 | |
| | 12 | //here, step is submitted for execution |
| | 13 | |
| | 14 | ... |
| | 15 | |
| | 16 | monitor.setStep(step); |
| | 17 | |
| | 18 | while (!monitor.isNotFinishedStep()) |
| | 19 | { |
| | 20 | monitor.checkStepStatus(); |
| | 21 | |
| | 22 | try |
| | 23 | { |
| | 24 | Thread.sleep(5000); |
| | 25 | } |
| | 26 | ... |
| | 27 | //continue to a next step |
| | 28 | ... |
| | 29 | }}} |
| | 30 | |
| | 31 | |