com.parabon.rapids
Class Job

java.lang.Object
  extended by com.parabon.rapids.Job

public class Job
extends java.lang.Object

Native Job Environment Job class.


Constructor Summary
Job(int _jobId)
          Construct a Rapids job from a JobId represented as an int.
Job(java.lang.String _jobId)
          Construct a Rapids job from a JobId represented as a String.
 
Method Summary
 boolean completed()
          Tests whether this job has completed.
static java.lang.String create(java.lang.String templateName, int nTasks, java.lang.String resultSetName, boolean keepRunning)
          Creates a new Job from a simple Rapids Template.
static java.lang.String create(java.lang.String templateName, java.lang.String dataSetName, java.lang.String resultSetName, boolean keepRunning)
          Creates a new Job from a complex Rapids Template.
 void delete()
          Deletes the job.
 boolean exists()
          Tests whether this job exists.
 java.lang.String getCmdLine()
          Returns the command line used to define this job.
 java.lang.String getId()
          Returns the JobID for this job.
 java.lang.String getLogFile()
          Returns the path to the log file for this job.
 java.lang.String getLogFile(java.lang.String taskId)
          Returns the path to the log file for the specified task in this job.
 TaskStatus[] getTaskStatus()
          Returns the current TaskStatuses for this job.
 boolean kill()
          Terminates the job.
 boolean killTask(java.lang.String taskId)
          Terminates the specified task in the job.
 void launch()
          Launch this job.
 boolean launched()
          Tests whether this job has been launched.
 void listen()
          Start a listener for this job.
 boolean listenerRunning()
          Tests whether a listener is running for this job.
static void main(java.lang.String[] args)
           
 boolean stop()
          Terminates the listener for the job.
 int update()
          Adds tasks to a job created from a complex Rapids Template.
 int update(int nTasks)
          Adds tasks to a job created from a simple Rapids Template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Job

public Job(java.lang.String _jobId)
Construct a Rapids job from a JobId represented as a String.


Job

public Job(int _jobId)
Construct a Rapids job from a JobId represented as an int.

Method Detail

getId

public java.lang.String getId()
Returns the JobID for this job.

Returns:
JobId for this job.

getCmdLine

public java.lang.String getCmdLine()
                            throws com.parabon.rapids.JobNotFoundException
Returns the command line used to define this job.

Returns:
Command line used to create this job.
Throws:
com.parabon.rapids.JobNotFoundException

getTaskStatus

public TaskStatus[] getTaskStatus()
                           throws com.parabon.rapids.JobNotFoundException
Returns the current TaskStatuses for this job.

Returns:
Current status of this jobs tasks
Throws:
com.parabon.rapids.JobNotFoundException

exists

public boolean exists()
Tests whether this job exists.

Returns:
True if this job exists, false otherwise.

completed

public boolean completed()
                  throws com.parabon.rapids.JobNotFoundException
Tests whether this job has completed.

Returns:
True if this job exists false otherwise.
Throws:
com.parabon.rapids.JobNotFoundException

launched

public boolean launched()
                 throws com.parabon.rapids.JobNotFoundException
Tests whether this job has been launched.

Returns:
True if this job exists false otherwise.
Throws:
com.parabon.rapids.JobNotFoundException

listenerRunning

public boolean listenerRunning()
                        throws com.parabon.rapids.JobNotFoundException,
                               java.io.IOException
Tests whether a listener is running for this job.

Returns:
True if this job exists false otherwise.
Throws:
com.parabon.rapids.JobNotFoundException
java.io.IOException

delete

public void delete()
            throws com.parabon.rapids.JobNotFoundException
Deletes the job.

Throws:
com.parabon.rapids.JobNotFoundException

getLogFile

public java.lang.String getLogFile()
                            throws com.parabon.rapids.JobNotFoundException
Returns the path to the log file for this job.

Returns:
The absolute path to the log file for this job
Throws:
com.parabon.rapids.JobNotFoundException

getLogFile

public java.lang.String getLogFile(java.lang.String taskId)
                            throws com.parabon.rapids.JobNotFoundException,
                                   com.parabon.rapids.TaskNotFoundException
Returns the path to the log file for the specified task in this job.

Returns:
The absolute path to the log file for the specified task
Throws:
com.parabon.rapids.JobNotFoundException
com.parabon.rapids.TaskNotFoundException

kill

public boolean kill()
             throws com.parabon.rapids.JobNotFoundException
Terminates the job.

Returns:
True if the kill signal was sent to the job, false otherwise.
Throws:
com.parabon.rapids.JobNotFoundException

killTask

public boolean killTask(java.lang.String taskId)
                 throws com.parabon.rapids.JobNotFoundException,
                        com.parabon.rapids.TaskNotFoundException
Terminates the specified task in the job.

Returns:
True if the kill signal was sent to the task, false otherwise.
Throws:
com.parabon.rapids.JobNotFoundException
com.parabon.rapids.TaskNotFoundException

stop

public boolean stop()
             throws com.parabon.rapids.JobNotFoundException
Terminates the listener for the job.

Returns:
True if the stop signal was sent to the job, false otherwise.
Throws:
com.parabon.rapids.JobNotFoundException

create

public static java.lang.String create(java.lang.String templateName,
                                      int nTasks,
                                      java.lang.String resultSetName,
                                      boolean keepRunning)
                               throws com.parabon.rapids.TemplateFormatException,
                                      java.io.IOException,
                                      com.parabon.rapids.BadParameterException
Creates a new Job from a simple Rapids Template.

Returns:
JobId for the newly created job
Throws:
com.parabon.rapids.TemplateFormatException
java.io.IOException
com.parabon.rapids.BadParameterException

create

public static java.lang.String create(java.lang.String templateName,
                                      java.lang.String dataSetName,
                                      java.lang.String resultSetName,
                                      boolean keepRunning)
                               throws com.parabon.rapids.TemplateFormatException,
                                      java.io.IOException,
                                      com.parabon.rapids.BadParameterException
Creates a new Job from a complex Rapids Template.

Returns:
JobId for the newly created job
Throws:
com.parabon.rapids.TemplateFormatException
java.io.IOException
com.parabon.rapids.BadParameterException

update

public int update(int nTasks)
           throws java.io.IOException,
                  com.parabon.rapids.BadParameterException,
                  com.parabon.rapids.JobNotFoundException
Adds tasks to a job created from a simple Rapids Template.

Returns:
Number of tasks added to job
Throws:
java.io.IOException
com.parabon.rapids.BadParameterException
com.parabon.rapids.JobNotFoundException

update

public int update()
           throws com.parabon.rapids.TemplateFormatException,
                  java.io.IOException,
                  com.parabon.rapids.BadParameterException,
                  com.parabon.rapids.JobNotFoundException
Adds tasks to a job created from a complex Rapids Template.

Returns:
Number of tasks added to job
Throws:
com.parabon.rapids.TemplateFormatException
java.io.IOException
com.parabon.rapids.BadParameterException
com.parabon.rapids.JobNotFoundException

launch

public void launch()
            throws java.io.IOException,
                   com.parabon.rapids.JobNotFoundException
Launch this job. If the job has already been launched, this method has no effect.

Throws:
java.io.IOException
com.parabon.rapids.JobNotFoundException

listen

public void listen()
            throws java.io.IOException,
                   com.parabon.rapids.JobNotFoundException
Start a listener for this job. If a listner is already running, this method has no effect.

Throws:
java.io.IOException
com.parabon.rapids.JobNotFoundException

main

public static void main(java.lang.String[] args)