eu.unicore.hila.grid
Interface Job

All Superinterfaces:
eu.unicore.hila.Resource, Task

public interface Job
extends Task

A Job is a real computational task that is executed on a compute resources. The distinctive properties are that it can be started with files that can be imported before execution, it has a working directory, stdout, stderr, and an exit status.

Author:
bjoernh

Method Summary
 List<SimpleTransfer> cleanup(File... exports)
          Export files from the working directory of the Job and remove it from its Site.
 int getExitCode()
          The exit code of the Job.
 String getLog()
          A log, if provided by the implementation.
 Site getSite()
          The Site that this Job is executed at.
 File getStdErr()
          A reference to the File representing stderr in the working directory of the Job.
 File getStdOut()
          A reference to the File representing stdout in the working directory of the Job.
 Calendar getSubmissionTime()
           
 String getTaskName()
          Name of the Job, potentially more descriptive than its id, but may be mapped to its id by an implementation.
 File getWorkingDirectory()
          The browsable working directory of a Job.
 void hold()
          Hold the job.
 void resume()
          Resume a held job.
 void startASync(File... imports)
          This method is essentially the same as startSync(File...), except that it returns immediately and executes the Task in the background.
 TaskStatus startASync(StatusChangeListener listener, File... imports)
          This method is similar to startASync(File...), but an additional parameter allows to provide a StatusChangeListener that is interested in receiving notifications of changes of the TaskStatus.
 TaskStatus startSync(File... imports)
          Synchronous start of the task.
 
Methods inherited from interface eu.unicore.hila.grid.Task
abort, block, block, getError, getHistory, getId, registerStatusChangeListener, removeStatusChangeListener, status
 
Methods inherited from interface eu.unicore.hila.Resource
getChild, getChildren, getLocation, getMetadata, getName, getParent, ok
 

Method Detail

startSync

TaskStatus startSync(File... imports)
                     throws eu.unicore.hila.exceptions.HiLAException
Synchronous start of the task. This method will return once the Task is in a final state (TaskStatus.SUCCESSFUL, TaskStatus.ABORTED, TaskStatus.FAILED). Files to be imported into the working directory before execution can be given as arguments.

Parameters:
imports - Files to be imported into the Job's working directory before starting the execution.
Returns:
TaskStatus at the end of execution.
Throws:
eu.unicore.hila.exceptions.HiLAException

startASync

void startASync(File... imports)
                throws eu.unicore.hila.exceptions.HiLAException
This method is essentially the same as startSync(File...), except that it returns immediately and executes the Task in the background.

Parameters:
imports - Files to be imported into the Job's working directory before starting the execution.
Throws:
eu.unicore.hila.exceptions.HiLAException

startASync

TaskStatus startASync(StatusChangeListener listener,
                      File... imports)
                      throws eu.unicore.hila.exceptions.HiLAException
This method is similar to startASync(File...), but an additional parameter allows to provide a StatusChangeListener that is interested in receiving notifications of changes of the TaskStatus.

Parameters:
listener - A StatusChangeListener interested in status changes of the Task
imports - Files to be imported into the Job's working directory before starting the execution.
Returns:
TaskStatus at the time the method returns, this is not necessarily a final state
Throws:
eu.unicore.hila.exceptions.HiLAException

cleanup

List<SimpleTransfer> cleanup(File... exports)
                             throws eu.unicore.hila.exceptions.HiLAException
Export files from the working directory of the Job and remove it from its Site.

Parameters:
exports - Files to be exported before removing the Job from the Site.
Returns:
List of SimpleTransfer representing the exports.
Throws:
eu.unicore.hila.exceptions.HiLAException

getExitCode

int getExitCode()
                throws eu.unicore.hila.exceptions.HiLAException
The exit code of the Job.

Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

getLog

String getLog()
              throws eu.unicore.hila.exceptions.HiLAException
A log, if provided by the implementation.

Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

getSite

Site getSite()
             throws eu.unicore.hila.exceptions.HiLAException
The Site that this Job is executed at.

Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

getStdErr

File getStdErr()
               throws eu.unicore.hila.exceptions.HiLAException
A reference to the File representing stderr in the working directory of the Job.

Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

getStdOut

File getStdOut()
               throws eu.unicore.hila.exceptions.HiLAException
A reference to the File representing stdout in the working directory of the Job.

Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

getSubmissionTime

Calendar getSubmissionTime()
                           throws eu.unicore.hila.exceptions.HiLAException
Returns:
A Calendar object representing the point in time when the job has been submitted.
Throws:
eu.unicore.hila.exceptions.HiLAException

getTaskName

String getTaskName()
                   throws eu.unicore.hila.exceptions.HiLAException
Name of the Job, potentially more descriptive than its id, but may be mapped to its id by an implementation.

Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

getWorkingDirectory

File getWorkingDirectory()
                         throws eu.unicore.hila.exceptions.HiLAException
The browsable working directory of a Job. It should be available as soon as the Job has been created.

Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

hold

void hold()
          throws eu.unicore.hila.exceptions.HiLAException
Hold the job.

Throws:
eu.unicore.hila.exceptions.HiLAException - Will be thrown, if the implementation or underlying systems don't support this operation.

resume

void resume()
            throws eu.unicore.hila.exceptions.HiLAException
Resume a held job.

Throws:
eu.unicore.hila.exceptions.HiLAException - Will be thrown, if the implementation or underlying systems don't support this operation.


Copyright © 2010-2013 UNICORE. All Rights Reserved.