gov.bnl.star.offline.scheduler
Class Request

java.lang.Object
  extended bygov.bnl.star.offline.scheduler.Request
All Implemented Interfaces:
java.io.Serializable

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

Holds all the informations describing a job to be executed by the scheduler. It contains the machine from which it was dispatched, the command line, the file required for input and output and the environment variables needed by the process. It can also handle the information about the processes to be dispatched in order to execute the job. The scheduler Policy will decide this information and put it in this class for the Dispatcher to use.

Version:
$Revision: 1.11 $ $Date: 2004/11/03 18:20:59 $
Author:
Gabriele Carcassi & Levente Hajdu
See Also:
Serialized Form

Field Summary
static java.net.URL discard
           
 
Constructor Summary
Request()
           
Request(org.w3c.dom.Document xmlDocument)
           
Request(java.lang.String username, java.lang.String command)
          Creates a new JobRequest without title and description.
Request(java.lang.String username, java.lang.String command, java.lang.String name, java.lang.String description)
          Creates a new JobRequest with a title and a description.
 
Method Summary
 void addToReportText(java.lang.String Text)
           
 java.lang.String getCommand()
          Returns the command line to be executed on the remote machine.
 java.lang.String getDescription()
          Returns a description of the job request.
 java.lang.String getFileListType()
          Getter for property fileListType.
 double getFilesPerHour()
          Getter for property filesPerHour.
 java.lang.String getID()
          Returns the base jobs ID
 java.util.List getInputList()
          Returns the list of data files that were requested as an input of the job.
 java.util.List getInputOrder()
          Getter for property inputOrder.
 java.lang.String getJobDescriptionFileName()
          Retrieves the filename of the orignal request sent to the scheduler.
 java.util.List getJobs()
          Returns a list of all the job objects of this request
 boolean getMail()
          Returns true if communication by mail from the queuing system is allowed.
 int getMaxFilesPerProcess()
          Returns the maximum number of files to be dispatched with one process.
 int getMaxMemory()
           
 int getMaxStorageSpace()
          Returns how much disk space a job will need to run.
 int getMaxWallTime()
          If this value is not set the default is -1
 int getMinFilesPerProcess()
          Returns the minimum number of files to be dispatched with one process.
 int getMinMemory()
           
 int getMinStorageSpace()
          Returns how much disk space a job will need to run.
 int getMinWallTime()
          If this value is not set the default is -1
 java.lang.String getName()
          Returns a title describing the job request.
 int getNProcesses()
          Getter for property nProcesses.
 java.util.List getOutputList()
          Return the list of data files that were requested as an output of the job.
 java.lang.String GetReportText()
           
 boolean getSimulation()
          Returns true if this job requests is only a simulations.
 java.net.URL getStdErr()
          Return the location to which the standard error has to be redirected.
 java.net.URL getStdIn()
          Returns the location from which the standard input will be read.
 java.net.URL getStdOut()
          Return the location to which the standard output has to be redirected.
 java.lang.String getUsername()
          Returns the user name under which the job has to run.
 boolean hasNoInput()
          Returns true if the job request didn't contain any input.
 void prepareInputOrder(java.lang.String commaSeparated)
           
 void setCommand(java.lang.String command)
          Sets the command line to be executed to the remote machine.
 void setFileListType(java.lang.String fileListType)
          Setter for property fileListType.
 void setFilesPerHour(double filesPerHour)
          Setter for property filesPerHour.
 void setHasInput()
          Marks the job request as one with input data defined.
 void setID(java.lang.String id)
          sets the base ID for the request
 void setInputOrder(java.util.List inputOrder)
          Setter for property inputOrder.
 void setJobDescriptionFileName(java.lang.String filename)
          Changes the filename of the orginal request sent to the scheduler.
 void setJobs(java.util.List jobs)
          Sets the list of jobs that where made from this request
 void setMail(boolean mail)
          Specifies if the queuing system is allowed to send mail to the user.
 void setMaxFilesPerProcess(int maxFilesPerProcess)
          Sets the maximum number of files to be dispatched with one process.
 void setMaxMemory(int maxMemory)
          Sets the maximum memory (ram) a job will need
 void setMaxStorageSpace(int maxStorageSpace)
          Sets the maximum diskspace a job will need
 void setMaxWallTime(int maxWallTime)
           
 void setMinFilesPerProcess(int maxFilesPerProcess)
          Sets the minimum number of files to be dispatched with one process.
 void setMinMemory(int minMemory)
          Sets the resource requirement, for the minimum amount of memory (ram) the job will need to run.
 void setMinStorageSpace(int minStorageSpace)
          Sets the minimum diskspace a job will need
 void setMinWallTime(int minWallTime)
           
 void setName(java.lang.String name)
           
 void setNProcesses(int nProcesses)
          Setter for property nProcesses.
 void SetReportText(java.lang.String Text)
           
 void setSimulation(boolean simulation)
          Set to true if this job requests is only to be simulated.
 void setStdErr(java.net.URL stderr)
          Sets the location in which the standard error will be saved.
 void setStdIn(java.net.URL stdin)
          Sets the location from which the standard input will be reed.
 void setStdOut(java.net.URL stdout)
          Sets the location in which the standard output will be saved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

discard

public static java.net.URL discard
Constructor Detail

Request

public Request()

Request

public Request(org.w3c.dom.Document xmlDocument)

Request

public Request(java.lang.String username,
               java.lang.String command)
Creates a new JobRequest without title and description.

Parameters:
username - the username submitting the job
command - the command line to be executed

Request

public Request(java.lang.String username,
               java.lang.String command,
               java.lang.String name,
               java.lang.String description)
Creates a new JobRequest with a title and a description.

Parameters:
username - the username submitting the job
command - the command line to be executed
name - a short description of the job
description - a more detailed description of the job
Method Detail

setID

public void setID(java.lang.String id)
sets the base ID for the request


getID

public java.lang.String getID()
Returns the base jobs ID


setJobs

public void setJobs(java.util.List jobs)
Sets the list of jobs that where made from this request


getJobs

public java.util.List getJobs()
Returns a list of all the job objects of this request


setJobDescriptionFileName

public void setJobDescriptionFileName(java.lang.String filename)
Changes the filename of the orginal request sent to the scheduler.


setHasInput

public void setHasInput()
Marks the job request as one with input data defined.


setCommand

public void setCommand(java.lang.String command)
Sets the command line to be executed to the remote machine. This method can be executed only if the current command is null, otherwise an exception will be thrown.

Parameters:
command - the command line to be executed

setStdIn

public void setStdIn(java.net.URL stdin)
Sets the location from which the standard input will be reed. This function can be called only once for JobDescription, meaning that once the input is set it cannot be changed. A second call will generate an IllegalArgumentException.

Parameters:
stdin - a file containing the input file to be redirected in the standard in

setStdOut

public void setStdOut(java.net.URL stdout)
Sets the location in which the standard output will be saved. This function can be called only once for JobDescription, meaning that once the output is set it cannot be changed. A second call will generate an IllegalArgumentException.

Parameters:
stdout - a file containing the output file where the standard out should be redirected

setStdErr

public void setStdErr(java.net.URL stderr)
Sets the location in which the standard error will be saved. This function can be called only once for JobDescription, meaning that once the output is set it cannot be changed. A second call will generate an IllegalArgumentException.

Parameters:
stderr - a file containing the output file where the standard error should be redirected

setSimulation

public void setSimulation(boolean simulation)
Set to true if this job requests is only to be simulated. By simulations we mean that the scheduler will prepare everything in the same way it would if it was not a simulation, but it wouldn't execute the final command for the job submission. For example, it would analize the job, check if it's a valid request, query the catalog, assign to target, prepare scripts, but don't dispatch the request.

This mode is intended to be used by advanced users and developers to check whether their request was executed correctly. The dispatcher is responsible to check for this flag, and implement fake dispatching.

Parameters:
simulation - true if no actual dispatching action is requested

setMail

public void setMail(boolean mail)
Specifies if the queuing system is allowed to send mail to the user.

Parameters:
mail - true if the user is allowed to recieve mail

setMaxFilesPerProcess

public void setMaxFilesPerProcess(int maxFilesPerProcess)
Sets the maximum number of files to be dispatched with one process.

Parameters:
maxFilesPerProcess - the maximum number of files to be dispatched with one process

setMinFilesPerProcess

public void setMinFilesPerProcess(int maxFilesPerProcess)
Sets the minimum number of files to be dispatched with one process.


setMaxStorageSpace

public void setMaxStorageSpace(int maxStorageSpace)
Sets the maximum diskspace a job will need


setMinStorageSpace

public void setMinStorageSpace(int minStorageSpace)
Sets the minimum diskspace a job will need


setMaxMemory

public void setMaxMemory(int maxMemory)
Sets the maximum memory (ram) a job will need


getMaxMemory

public int getMaxMemory()

setFileListType

public void setFileListType(java.lang.String fileListType)
Setter for property fileListType.

Parameters:
fileListType - New value of property fileListType.

setFilesPerHour

public void setFilesPerHour(double filesPerHour)
Setter for property filesPerHour.

Parameters:
filesPerHour - New value of property filesPerHour.

getJobDescriptionFileName

public java.lang.String getJobDescriptionFileName()
Retrieves the filename of the orignal request sent to the scheduler.


getUsername

public java.lang.String getUsername()
Returns the user name under which the job has to run.

Returns:
the username submitting the job

hasNoInput

public boolean hasNoInput()
Returns true if the job request didn't contain any input.

Returns:
true if not input was specified

getCommand

public java.lang.String getCommand()
Returns the command line to be executed on the remote machine.

Returns:
the command line to be executed

getName

public java.lang.String getName()
Returns a title describing the job request.

Returns:
a short description of the job

setName

public void setName(java.lang.String name)

getDescription

public java.lang.String getDescription()
Returns a description of the job request.

Returns:
a full description of the job

getStdIn

public java.net.URL getStdIn()
Returns the location from which the standard input will be read.

Returns:
the file from which to redirect the standard in

getStdOut

public java.net.URL getStdOut()
Return the location to which the standard output has to be redirected.

Returns:
a file containing the output file where the standard out should be redirected

getStdErr

public java.net.URL getStdErr()
Return the location to which the standard error has to be redirected.

Returns:
a file containing the output file where the standard error should be redirected

getInputList

public java.util.List getInputList()
Returns the list of data files that were requested as an input of the job.

Returns:
the requested input file list

getOutputList

public java.util.List getOutputList()
Return the list of data files that were requested as an output of the job.

Returns:
the requested output file list

getSimulation

public boolean getSimulation()
Returns true if this job requests is only a simulations. By simulations we mean that the scheduler will prepare everything in the same way it would if it was not a simulation, but it wouldn't execute the final command for the job submission. For example, it would analize the job, check if it's a valid request, query the catalog, assign to target, prepare scripts, but don't dispatch the request.

This mode is intended to be used by advanced users and developers to check whether their request was executed correctly. The dispatcher is responsible to check for this flag, and implement fake dispatching.

Returns:
true if the scheduler shouldn't dispatch the job

getMail

public boolean getMail()
Returns true if communication by mail from the queuing system is allowed.

Returns:
true if the output, or other messages, can be sent by mail

getMaxStorageSpace

public int getMaxStorageSpace()
Returns how much disk space a job will need to run.


getMinStorageSpace

public int getMinStorageSpace()
Returns how much disk space a job will need to run.


getMinMemory

public int getMinMemory()

setMinMemory

public void setMinMemory(int minMemory)
Sets the resource requirement, for the minimum amount of memory (ram) the job will need to run.

Parameters:
minMemory - resource requirement, for the minimum amount of memory (ram) the job will need to run.

getMaxFilesPerProcess

public int getMaxFilesPerProcess()
Returns the maximum number of files to be dispatched with one process.

Returns:
the maximum number of files to be dispatched with one process

getMinFilesPerProcess

public int getMinFilesPerProcess()
Returns the minimum number of files to be dispatched with one process.


getFileListType

public java.lang.String getFileListType()
Getter for property fileListType.

Returns:
Value of property fileListType.

getFilesPerHour

public double getFilesPerHour()
Getter for property filesPerHour.

Returns:
Value of property filesPerHour.

getInputOrder

public java.util.List getInputOrder()
Getter for property inputOrder.

Returns:
Value of property inputOrder.

setInputOrder

public void setInputOrder(java.util.List inputOrder)
Setter for property inputOrder.

Parameters:
inputOrder - New value of property inputOrder.

prepareInputOrder

public void prepareInputOrder(java.lang.String commaSeparated)

getNProcesses

public int getNProcesses()
Getter for property nProcesses. Returns -1 if nProcess is not set.

Returns:
Value of property nProcesses.

setNProcesses

public void setNProcesses(int nProcesses)
Setter for property nProcesses.

Parameters:
nProcesses - New value of property nProcesses.

addToReportText

public void addToReportText(java.lang.String Text)

SetReportText

public void SetReportText(java.lang.String Text)

GetReportText

public java.lang.String GetReportText()

setMaxWallTime

public void setMaxWallTime(int maxWallTime)

getMaxWallTime

public int getMaxWallTime()
If this value is not set the default is -1


setMinWallTime

public void setMinWallTime(int minWallTime)

getMinWallTime

public int getMinWallTime()
If this value is not set the default is -1



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