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.
 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 the job has completed, 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 has been launched, 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 a listener is running for this job, 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

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.

Parameters:
templateName - name of the template to be used in creating the job
nTasks - number of tasks to create
resultSetName - name of the result set the job will create
keepRunning - if true, the listener will not automatically terminate when the last task completes
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.

Parameters:
templateName - name of the template to be used in creating the job
dataSetName - name of the data set to use in creating the job
resultSetName - name of the result set the job will create
keepRunning - if true, the listener will not automatically terminate when the last task completes
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,
                  com.parabon.rapids.TemplateFormatException
Adds tasks to a job created from a simple Rapids Template.

Parameters:
nTasks - number of new tasks to add to the job
Returns:
Number of tasks added to job
Throws:
JobNotFoundException
TemplateFormatException
java.io.IOException
com.parabon.rapids.BadParameterException

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 listener 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)


Copyright © 2010 Parabon Computation, Inc. All Rights Reserved.