gov.bnl.star.offline.scheduler.Dispatchers.xgrid
Class BashApplication

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.Dispatchers.xgrid.BashApplication
All Implemented Interfaces:
java.io.Serializable

public class BashApplication
extends java.lang.Object
implements java.io.Serializable

Application module for csh.

This module defines the interface of a csh task, and prepare the task information in the following environment variables:

$JOBID - the unique job id given by the scheduler
$FILESLIST - the file name of a text file containing the file list assigned to the job
$INPUTFILECOUNT - the number of files assigned to the job
$INPUTFILExx - the input files associated to the job

Version:
1.0 2002/12/26
Author:
Gabriele Carcassi, Jerome Lauret, Levente Hajdu
See Also:
Serialized Form

Constructor Summary
BashApplication()
          Creates a new instance of CSHApplication
 
Method Summary
 java.lang.String FillCopyCommand(java.lang.String command, java.lang.String fromScratch, java.lang.String toURL, boolean isGrid)
          replaces the (fromScratch) and the (toURL) in the copy command with the true path
 java.lang.String getCommandLine()
          Returns the command line to execute the task set by setJob.
 java.lang.String getCopyCommand()
           
 java.lang.String getCopyScript()
          Getter for property copyScript.
 java.lang.String getCSHScriptFileName()
          Returns the name for the csh script (without the path).
 java.lang.String getCSHScriptName()
          Returns the path and name for the csh script.
 int getEnvVariableLimit()
          Getter for property EnvVariableLimit.
 java.lang.String getGridCopyCommand()
           
 java.lang.String getHelperScripts()
           
 java.lang.String getInitializationScript()
           
 java.lang.String getInputFileListName()
          Returns the name for the input file list file.
 java.lang.String getJobName()
          Returns the job name to be assigned to the batch system.
 java.lang.String getMakeExecutableCommand()
          Returns the chmod command from the config file
 java.lang.String getRecursiveCopyCommand()
           
 java.lang.String getRegisterScript()
          Getter for property registerScript.
 java.lang.String getStderr()
          Returns the file for standard error redirection.
 java.lang.String getStdin()
          Returns the file for standard input redirection.
 java.lang.String getStdout()
          Returns the file for standard output redirection.
 java.lang.String getStorageScript()
          Getter for property storageScript.
 java.lang.String importPakages()
           
 boolean isRecurseCopy()
          Getter for property recurseCopy.
 void prepareJob()
          Prepares the task, by creating the script.
 void setCopyCommand(java.lang.String CopyCommand)
          sets the command for copying files back, when the user asks for use (fromScratch) for source and (toURL) for destination.
 void setCopyScript(java.lang.String copyScript)
          Setter for property copyScript.
 void setEnvVariableLimit(int EnvVariableLimit)
          Setter for property EnvVariableLimit.
 void setGridCopyCommand(java.lang.String gridCopyCommand)
          sets the command for copying files back, when the user asks for use (fromScratch) for source and (toURL) for destination.
 void setHelperScripts(java.lang.String helperScripts)
           
 void setInitializationScript(java.lang.String initializationScript)
           
 void setJob(Request request, Job job)
          Sets the task the application will have to prepare.
 void setMakeExecutableCommand(java.lang.String makeExecutableCommand)
           
 void setRecurseCopy(boolean recurseCopy)
          Setter for property recurseCopy.
 void setRecursiveCopyCommand(java.lang.String recursiveCopyCommand)
          sets the command for copying files back, when the user asks for use (fromScratch) for source and (toURL) for destination.
 void setRegisterScript(java.lang.String registerScript)
          Setter for property registerScript.
 void setStorageScript(java.lang.String storageScript)
          Setter for property storageScript.
 void setSubmissionCommand(java.lang.String submissionCommand)
          Sets the submittion command used to submit the job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BashApplication

public BashApplication()
Creates a new instance of CSHApplication

Method Detail

prepareJob

public void prepareJob()
Prepares the task, by creating the script.


getCommandLine

public java.lang.String getCommandLine()
Returns the command line to execute the task set by setJob.

Returns:
Command line to execute the task

getMakeExecutableCommand

public java.lang.String getMakeExecutableCommand()
Returns the chmod command from the config file


setMakeExecutableCommand

public void setMakeExecutableCommand(java.lang.String makeExecutableCommand)

setJob

public void setJob(Request request,
                   Job job)
Sets the task the application will have to prepare.

Parameters:
request - the request that originated the task
job - the job to be executed

setSubmissionCommand

public void setSubmissionCommand(java.lang.String submissionCommand)
Sets the submittion command used to submit the job. This will be included in the script for resubmission.

Parameters:
submissionCommand - the command line to submit the job to the batch system

getCSHScriptName

public java.lang.String getCSHScriptName()
Returns the path and name for the csh script.

Returns:
the csh script path and name

getCSHScriptFileName

public java.lang.String getCSHScriptFileName()
Returns the name for the csh script (without the path).

Returns:
the csh script name (without the path)

getInputFileListName

public java.lang.String getInputFileListName()
Returns the name for the input file list file.

Returns:
the input file list name

getStdin

public java.lang.String getStdin()
Returns the file for standard input redirection.

Returns:
stdin file

getStdout

public java.lang.String getStdout()
Returns the file for standard output redirection.

Returns:
stdout file

getStderr

public java.lang.String getStderr()
Returns the file for standard error redirection.

Returns:
stderr file

getJobName

public java.lang.String getJobName()
Returns the job name to be assigned to the batch system.

Returns:
the job name to be used by the batch system

isRecurseCopy

public boolean isRecurseCopy()
Getter for property recurseCopy.

Returns:
Value of property recurseCopy.

setRecurseCopy

public void setRecurseCopy(boolean recurseCopy)
Setter for property recurseCopy.

Parameters:
recurseCopy - New value of property recurseCopy.

getEnvVariableLimit

public int getEnvVariableLimit()
Getter for property EnvVariableLimit.

Returns:
Value of property EnvVariableLimit.

setEnvVariableLimit

public void setEnvVariableLimit(int EnvVariableLimit)
Setter for property EnvVariableLimit.

Parameters:
EnvVariableLimit - New value of property EnvVariableLimit.

getCopyScript

public java.lang.String getCopyScript()
Getter for property copyScript.

Returns:
Value of property copyScript.

setCopyScript

public void setCopyScript(java.lang.String copyScript)
Setter for property copyScript.

Parameters:
copyScript - New value of property copyScript.

getStorageScript

public java.lang.String getStorageScript()
Getter for property storageScript.

Returns:
Value of property storageScript.

setStorageScript

public void setStorageScript(java.lang.String storageScript)
Setter for property storageScript.

Parameters:
storageScript - New value of property storageScript.

getRegisterScript

public java.lang.String getRegisterScript()
Getter for property registerScript.

Returns:
Value of property registerScript.

setRegisterScript

public void setRegisterScript(java.lang.String registerScript)
Setter for property registerScript.

Parameters:
registerScript - New value of property registerScript.

setGridCopyCommand

public void setGridCopyCommand(java.lang.String gridCopyCommand)
sets the command for copying files back, when the user asks for use (fromScratch) for source and (toURL) for destination. Example: globus-url-copy file://$SCRATCH/(fromScratch) gsiftp://stragrid04.star.bnl.gov/(toURL)


getGridCopyCommand

public java.lang.String getGridCopyCommand()

setCopyCommand

public void setCopyCommand(java.lang.String CopyCommand)
sets the command for copying files back, when the user asks for use (fromScratch) for source and (toURL) for destination. Example: /bin/cp $SCRATCH/(fromScratch) (toURL)


getCopyCommand

public java.lang.String getCopyCommand()

setRecursiveCopyCommand

public void setRecursiveCopyCommand(java.lang.String recursiveCopyCommand)
sets the command for copying files back, when the user asks for use (fromScratch) for source and (toURL) for destination. Example: /bin/cp -r $SCRATCH/(fromScratch) (toURL)


getRecursiveCopyCommand

public java.lang.String getRecursiveCopyCommand()

FillCopyCommand

public java.lang.String FillCopyCommand(java.lang.String command,
                                        java.lang.String fromScratch,
                                        java.lang.String toURL,
                                        boolean isGrid)
replaces the (fromScratch) and the (toURL) in the copy command with the true path


getHelperScripts

public java.lang.String getHelperScripts()

setHelperScripts

public void setHelperScripts(java.lang.String helperScripts)

getInitializationScript

public java.lang.String getInitializationScript()

setInitializationScript

public void setInitializationScript(java.lang.String initializationScript)

importPakages

public java.lang.String importPakages()


Copyright © 2002-2004 STAR collaboration - Brookhaven National Laboratory. All Rights Reserved.