g-Eclipse
Release 1.0.0

eu.geclipse.batch
Interface IBatchService

All Known Implementing Classes:
AbstractBatchService, PBSBatchService

public interface IBatchService

Wrapper for executing commands on a batch service. IMPORTANT: Make all the public methods of an implementation of this interface synchronized.


Method Summary
 boolean connectToServer(ISSHConnectionInfo sshConnectionInfo)
          Establishes a ssh-connection to the server running the batch service.
 void createQueue(DocumentRoot documentRoot)
          Executes command that will create a new queue with the root element of a Queue Description Language (QDL) document and argument.
 void createQueue(java.lang.String queueName, int priority, IQueueInfo.QueueType type, boolean enabled, boolean started, int runMax, double timeCPU, double timeWall, int queMax, int assignedResources, java.util.List<java.lang.String> vos)
          Executes command that will create a new queue with a "default" number of argument.
 void createQueue(java.lang.String queueName, IQueueInfo.QueueType type, boolean enabled, double timeCPU, double timeWall, java.util.List<java.lang.String> vos)
          Executes command that will create a new queue with minimum arguments.
 void delJob(java.lang.String jobId)
          Deletes a job in the queues of the batch service.
 void delQueue(java.lang.String queueId)
          Deletes the specified queue.
 void disableQueue(java.lang.String queueId)
          Sets the specified queue to be disabled, i.e. closes it for new jobs.
 void disableQueues(java.lang.String[] queueIds)
          Sets the specified queues to be disabled, i.e. closes them for new jobs.
 void disableWN(java.lang.String nodeId)
          Changes the state of a workernode to offline, no jobs will be placed on this workernode.
 void disconnectFromServer()
          Tears down an already established ssh-connection to the server.
 void enableQueue(java.lang.String queueId)
          Enable the specified queue, i.e. new jobs can be inserted into the queue.
 void enableQueues(java.lang.String[] queueIds)
          Enables the specified queues, i.e. new jobs can be inserted into the queues.
 void enableWN(java.lang.String nodeId)
          Changes the state of a workernode to enable, jobs will be placed on this workernode.
 IBatchServiceDescription getDescription()
          Get the batch service description that was used to create this service.
 void getJobs(IBatchJobManager manager)
          Returns a List of the jobs as IBatchJobInfo.
 java.lang.String getName()
          Get the batch service name, i.e. the configuration file that were used to instantiate this service.
 java.util.List<IQueueInfo> getQueues()
          Returns a list of the queues as IQueueInfo.
 java.util.List<IWorkerNodeInfo> getWorkerNodes()
          Executes pbsnodes on the PBS server and returns a list of the workernodes as WorkerNodeInfo.
 void holdJob(java.lang.String jobId)
          Puts a hold on a job in the queue of the batch service.
 void holdJobs(java.lang.String[] jobIds)
          Puts a hold on one or more jobs in the queue of the batch service.
 void moveJob(java.lang.String jobId, java.lang.String destQueue, java.lang.String destServer)
          Moves a job in the batch system to another batch system and/or queue.
 void moveJobs(java.lang.String[] jobIds, java.lang.String destQueue, java.lang.String destServer)
          Move jobs in the batch system to another batch system and/or queue.
 void releaseJob(java.lang.String jobId)
          Release a job with a previous hold in queue of the batch system.
 void releaseJobs(java.lang.String[] jobIds)
          Release one or more jobs with a previous hold in queue of the batch system.
 void reRunJob(java.lang.String jobId)
          Rerun a currently running job.
 void reRunJobs(java.lang.String[] jobIds)
          Rerun one or more currently running jobs.
 void setMaxWallTime(java.lang.String queueName, java.lang.String timeWall)
          Executes command that will change the maximum allowed wall time of a specific queue.
 void startQueue(java.lang.String queueId)
          Executes qstart to start a specific queue.
 void startQueues(java.lang.String[] queueIds)
          Executes qstart to start all specified queues.
 void stopQueue(java.lang.String queueId)
          Executes qstop to stop a specific queue.
 void stopQueues(java.lang.String[] queueIds)
          Executes qstop to stop all specified queues.
 

Method Detail

getDescription

IBatchServiceDescription getDescription()
Get the batch service description that was used to create this service.

Returns:
The description from which this service was created.

getName

java.lang.String getName()
Get the batch service name, i.e. the configuration file that were used to instantiate this service.

Returns:
The batch service name.

connectToServer

boolean connectToServer(ISSHConnectionInfo sshConnectionInfo)
                        throws ProblemException
Establishes a ssh-connection to the server running the batch service.

Parameters:
sshConnectionInfo - Holding the information needed to establish a ssh connection with the PBS server.
Returns:
Returns true if the connection is established, false otherwise.
Throws:
ProblemException - In case of connection problem to service

disconnectFromServer

void disconnectFromServer()
Tears down an already established ssh-connection to the server.


getJobs

void getJobs(IBatchJobManager manager)
             throws ProblemException
Returns a List of the jobs as IBatchJobInfo. If no jobs are running or error then this method will return null.

Parameters:
manager - The manager where the jobs will be merged into.
Throws:
ProblemException - If command is not executed successfully

delJob

void delJob(java.lang.String jobId)
            throws ProblemException
Deletes a job in the queues of the batch service.

Parameters:
jobId - The identifier of the job to be deleted.
Throws:
ProblemException - If command is not executed successfully

moveJob

void moveJob(java.lang.String jobId,
             java.lang.String destQueue,
             java.lang.String destServer)
             throws ProblemException
Moves a job in the batch system to another batch system and/or queue.

Parameters:
jobId - The identifier of the job to be moved.
destQueue - The destination queue, null if no destination queue.
destServer - The destination server, null if no destination server.
Throws:
ProblemException - If command is not executed successfully

moveJobs

void moveJobs(java.lang.String[] jobIds,
              java.lang.String destQueue,
              java.lang.String destServer)
              throws ProblemException
Move jobs in the batch system to another batch system and/or queue.

Parameters:
jobIds - The identifier of the jobs to be moved.
destQueue - The destination queue, null if no destination queue.
destServer - The destination server, null if no destination server.
Throws:
ProblemException - If command is not executed successfully

holdJob

void holdJob(java.lang.String jobId)
             throws ProblemException
Puts a hold on a job in the queue of the batch service.

Parameters:
jobId - The identifier of the job to be held.
Throws:
ProblemException - If command is not executed successfully

holdJobs

void holdJobs(java.lang.String[] jobIds)
              throws ProblemException
Puts a hold on one or more jobs in the queue of the batch service.

Parameters:
jobIds - The identifiers of the jobs to be held.
Throws:
ProblemException - If command is not executed successfully

releaseJob

void releaseJob(java.lang.String jobId)
                throws ProblemException
Release a job with a previous hold in queue of the batch system.

Parameters:
jobId - The identifier of the job to be released.
Throws:
ProblemException - If command is not executed successfully

releaseJobs

void releaseJobs(java.lang.String[] jobIds)
                 throws ProblemException
Release one or more jobs with a previous hold in queue of the batch system.

Parameters:
jobIds - The identifiers of the jobs to be released.
Throws:
ProblemException - If command is not executed successfully

reRunJob

void reRunJob(java.lang.String jobId)
              throws ProblemException
Rerun a currently running job.

Parameters:
jobId - The identifier of the job to be rerun.
Throws:
ProblemException - If command is not executed successfully

reRunJobs

void reRunJobs(java.lang.String[] jobIds)
               throws ProblemException
Rerun one or more currently running jobs.

Parameters:
jobIds - The identifiers of the jobs to be rerun.
Throws:
ProblemException - If command is not executed successfully

getWorkerNodes

java.util.List<IWorkerNodeInfo> getWorkerNodes()
                                               throws ProblemException
Executes pbsnodes on the PBS server and returns a list of the workernodes as WorkerNodeInfo. If no workernodes or error parsing the output then this method will return null. The output of pbsnodes are as follows:

Returns:
A List of IWorkerNodeInfo or null.
Throws:
ProblemException - If command is not executed successfully

disableWN

void disableWN(java.lang.String nodeId)
               throws ProblemException
Changes the state of a workernode to offline, no jobs will be placed on this workernode.

Parameters:
nodeId - The identifier of the node to be disabled.
Throws:
ProblemException - If command is not executed successfully

enableWN

void enableWN(java.lang.String nodeId)
              throws ProblemException
Changes the state of a workernode to enable, jobs will be placed on this workernode.

Parameters:
nodeId - The identifier of the node to be disabled.
Throws:
ProblemException - If command is not executed successfully

getQueues

java.util.List<IQueueInfo> getQueues()
                                     throws ProblemException
Returns a list of the queues as IQueueInfo. If no queues or error then this method will return null.

Returns:
A List of IQueueInfo or null.
Throws:
ProblemException - If command is not executed successfully

disableQueue

void disableQueue(java.lang.String queueId)
                  throws ProblemException
Sets the specified queue to be disabled, i.e. closes it for new jobs.

Parameters:
queueId - The identifier of the queue to be disabled.
Throws:
ProblemException - If command is not executed successfully

disableQueues

void disableQueues(java.lang.String[] queueIds)
                   throws ProblemException
Sets the specified queues to be disabled, i.e. closes them for new jobs.

Parameters:
queueIds - The identifiers of the queues to be drained.
Throws:
ProblemException - If command is not executed successfully

enableQueue

void enableQueue(java.lang.String queueId)
                 throws ProblemException
Enable the specified queue, i.e. new jobs can be inserted into the queue.

Parameters:
queueId - The identifier of the queue to be enabled.
Throws:
ProblemException - If command is not executed successfully

enableQueues

void enableQueues(java.lang.String[] queueIds)
                  throws ProblemException
Enables the specified queues, i.e. new jobs can be inserted into the queues.

Parameters:
queueIds - The identifiers of the queues to be enabled.
Throws:
ProblemException - If command is not executed successfully

startQueue

void startQueue(java.lang.String queueId)
                throws ProblemException
Executes qstart to start a specific queue.

Parameters:
queueId - The identifier of the queue to be started.
Throws:
ProblemException - If command is not executed successfully

startQueues

void startQueues(java.lang.String[] queueIds)
                 throws ProblemException
Executes qstart to start all specified queues.

Parameters:
queueIds - The identifiers of the queues to be started.
Throws:
ProblemException - If command is not executed successfully

stopQueue

void stopQueue(java.lang.String queueId)
               throws ProblemException
Executes qstop to stop a specific queue.

Parameters:
queueId - The identifier of the queue to be stopped.
Throws:
ProblemException - If command is not executed successfully

stopQueues

void stopQueues(java.lang.String[] queueIds)
                throws ProblemException
Executes qstop to stop all specified queues.

Parameters:
queueIds - The identifiers of the queues to be stopped.
Throws:
ProblemException - If command is not executed successfully

createQueue

void createQueue(java.lang.String queueName,
                 IQueueInfo.QueueType type,
                 boolean enabled,
                 double timeCPU,
                 double timeWall,
                 java.util.List<java.lang.String> vos)
                 throws ProblemException
Executes command that will create a new queue with minimum arguments.

Parameters:
queueName - The name of the new queue.
type - The type of the new queue.
enabled - The state of the new queue.
timeCPU - Maximum allowed CPU time for any job.
timeWall - Maximum allowed wall time for any job.
vos - Only allow access to the specified vos, null no restriction is applied.
Throws:
ProblemException - If command is not executed successfully

createQueue

void createQueue(java.lang.String queueName,
                 int priority,
                 IQueueInfo.QueueType type,
                 boolean enabled,
                 boolean started,
                 int runMax,
                 double timeCPU,
                 double timeWall,
                 int queMax,
                 int assignedResources,
                 java.util.List<java.lang.String> vos)
                 throws ProblemException
Executes command that will create a new queue with a "default" number of argument.

Parameters:
queueName - The name of the new queue.
priority - The priority of the new queue.
type - The type of the new queue.
enabled - The state of the new queue.
started - If the new queue will be started when created.
runMax - Maximum running jobs at any given time from the queue.
timeCPU - Maximum allowed CPU time for any job.
timeWall - Maximum allowed wall time for any job.
queMax - Maximum allowed jobs in the queue
assignedResources -
vos - Only allow access to the specified vos, null no restriction is applied.
Throws:
ProblemException - If command is not executed successfully

createQueue

void createQueue(DocumentRoot documentRoot)
                 throws ProblemException
Executes command that will create a new queue with the root element of a Queue Description Language (QDL) document and argument.

Parameters:
documentRoot - The root element of a QDL document.
Throws:
ProblemException

delQueue

void delQueue(java.lang.String queueId)
              throws ProblemException
Deletes the specified queue.

Parameters:
queueId - The identifier of the queue to be deleted.
Throws:
ProblemException - If command is not executed successfully

setMaxWallTime

void setMaxWallTime(java.lang.String queueName,
                    java.lang.String timeWall)
                    throws ProblemException
Executes command that will change the maximum allowed wall time of a specific queue.

Parameters:
queueName - The name of the queue to be modified.
timeWall - The new maximum allowed wall time for any job.
Throws:
ProblemException - If command is not executed successfully

g-Eclipse
Release 1.0.0