plgrid
Class PipelineGridPlugin

java.lang.Object
  extended by plgrid.PipelineGridPlugin

public abstract class PipelineGridPlugin
extends java.lang.Object

Responsible for communication of plugin with Pipeline server. All Pipeline Grid plugins should be extended from this class.


Field Summary
static java.lang.String VERSION
           
 
Constructor Summary
PipelineGridPlugin()
          Initializes Pipeline Grid Plugin class
 
Method Summary
 void fireEvent(GridEvent ge)
          All plugins should send events to Pipeline via this method.
 java.util.List<GridJobInfo> getBulkJobInfo(java.util.List<java.lang.String> jobIdList)
          Returns bulk information of multiple jobs.
abstract  GridJobInfo getJobInfo(java.lang.String jobId)
          Returns information of the job with specified jobId.
abstract  java.util.List<GridJobInfo> getJobList(java.lang.String complexVariables)
          Returns the list of all active jobs of grid manager.
 java.util.Map<java.lang.String,java.lang.String> getPreferences()
           
abstract  void killJob(java.lang.String jobId, java.lang.String username, boolean force)
          Responsible for job removal from the Grid manager.
static void main(java.lang.String[] args)
           
 void registerEventListener(GridEventListener gel)
          Pipeline calls this function to register itself as a listener to the plugin
 void setPreferences(java.util.Map<java.lang.String,java.lang.String> plPreferences)
          Makes pipeline preferences available for grid plugin.
abstract  java.lang.String submitJob(GridJobSubmitInfo gji)
          Responsible for job to be submitted to the Grid.
 void unregisterEventListener(GridEventListener gel)
          Pipeline calls this function to unregister its listener from the plugin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values
Constructor Detail

PipelineGridPlugin

public PipelineGridPlugin()
Initializes Pipeline Grid Plugin class

Method Detail

registerEventListener

public final void registerEventListener(GridEventListener gel)
Pipeline calls this function to register itself as a listener to the plugin

Parameters:
gel - Listener to register

unregisterEventListener

public final void unregisterEventListener(GridEventListener gel)
Pipeline calls this function to unregister its listener from the plugin

Parameters:
gel - Listener to unregister

fireEvent

public final void fireEvent(GridEvent ge)
All plugins should send events to Pipeline via this method.

Parameters:
ge - Event which will be sent to Pipeline

setPreferences

public void setPreferences(java.util.Map<java.lang.String,java.lang.String> plPreferences)
Makes pipeline preferences available for grid plugin.


getPreferences

public java.util.Map<java.lang.String,java.lang.String> getPreferences()

submitJob

public abstract java.lang.String submitJob(GridJobSubmitInfo gji)
Responsible for job to be submitted to the Grid. Required to be overriden by extended classes.

Parameters:
gji - This is a Pipeline defined class, which contains information about job to be submitted. See class definition for more details.
Returns:
Job Id of submitted job on success; Otherwise "ERROR" + error message

killJob

public abstract void killJob(java.lang.String jobId,
                             java.lang.String username,
                             boolean force)
Responsible for job removal from the Grid manager. Required to be overriden by extended classes. Pipeline calls this method when it needs to delete a job from the cluster so it calls with

force

flag set to false. Then, after some time it checks if the job has been successfully deleted, in case the job is still running, it calls this method again with

force

flag set to true.

Parameters:
jobId - Job Id of the job
username - The username of the user who submitted the job, or has enough permission to kill the job
force - A boolean flag which tells whether the job needs to be killed with or without force.

getJobList

public abstract java.util.List<GridJobInfo> getJobList(java.lang.String complexVariables)
Returns the list of all active jobs of grid manager. If parameter complexVariables is null, then the list of all jobs ( including jobs which are not submitted by Pipeline) will be returned to Pipeline. If this method is not overridden then Pipeline will not be able to restore running job information, it will resubmit jobs when server restarts.

Parameters:
complexVariables - List of complex variables which Pipeline server is using. Null if no complex variables are used. If multiple complex variables are used, then those values should be separated by comma. Example: pipeline, id=loni
Returns:
List of GridJobInfo for current active jobs; null if failed or not supported.

getJobInfo

public abstract GridJobInfo getJobInfo(java.lang.String jobId)
Returns information of the job with specified jobId. If this method is not overridden then Pipeline will not be able to correctly handle job synchronization with accounting.

Parameters:
jobId - Job Id of the required job
Returns:
GridJobInfo object of specified job not found.

getBulkJobInfo

public java.util.List<GridJobInfo> getBulkJobInfo(java.util.List<java.lang.String> jobIdList)
Returns bulk information of multiple jobs. Job Ids of needed jobs should be specified at jobIdList.

Parameters:
jobIdList - A list of job ids .
Returns:
List List of GridJobInfo objects;

main

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