@PublicAPI public class FlatJobFactory extends Object
CMD_FILE_COMMENT_CHAR
and empty lines.
dependencies between tasks cannot be set, task names are automatically set. A log file can be specified.
A selection script can be associated for all the tasks, but not specific selection script for each tasks.
A Job name can be specified too.
This class does not intend to provide a job specification with all ProActive Scheduler jobs feature, but is
way to define quickly jobs made of native tasks to execute in parallel.
If you need to define jobs with dependencies, jobs with java Tasks, specific selection script for each task,
or generation scripts... you should rather use XML job descriptors and JobFactory
.
the class presents too a way to create a job made of one task from a String representing a native command to launch.Modifier and Type | Field and Description |
---|---|
static String |
CMD_FILE_COMMENT_CHAR
comment character used to ignore line in text file containing
native commands
|
static String |
JOB_DEFAULT_NAME_PREFIX
String prefix used to build default job name (if no job name is specified).
|
static org.apache.log4j.Logger |
logger
Log4j logger name
|
Constructor and Description |
---|
FlatJobFactory() |
Modifier and Type | Method and Description |
---|---|
Job |
createNativeJobFromCommand(String command,
String jobName,
String selectionScriptPath,
String userName)
Creates a job from a String representing a native command to launch.
|
Job |
createNativeJobFromCommandsFile(String commandFilePath,
String jobName,
String selectionScriptPath,
String userName)
Create a job from a String representing file path, this text file contains native commands to launch
Every line of the text file is taken and considered as a native command from which a native task is built,
except lines beginning with
JOB_DEFAULT_NAME_PREFIX and empty lines. |
static FlatJobFactory |
getFactory()
Return the instance of the jobFactory.
|
public static org.apache.log4j.Logger logger
public static final String CMD_FILE_COMMENT_CHAR
public static final String JOB_DEFAULT_NAME_PREFIX
public static FlatJobFactory getFactory()
public Job createNativeJobFromCommandsFile(String commandFilePath, String jobName, String selectionScriptPath, String userName) throws JobCreationException
JOB_DEFAULT_NAME_PREFIX
and empty lines.
So job in result is made of several native tasks without dependencies.commandFilePath
- a string representing a text file containing native commands.jobName
- A String representing a name to give to the job. If null, default job name is made of
JOB_DEFAULT_NAME_PREFIX
+ userName parameter.selectionScriptPath
- a Path to a file containing a selection script, or null if
no script is needed.userName
- name of connected user that asked job creation, null otherwise. This parameter
is only used for default job's name creation.JobCreationException
- with a relevant error message if an error occurs.public Job createNativeJobFromCommand(String command, String jobName, String selectionScriptPath, String userName) throws JobCreationException
command
- a string representing an executable command to launch.jobName
- A String representing a name to give to the job, if null. default job name is made of
{link FlatJobFactory#JOB_DEFAULT_NAME_PREFIX} + userName parameter.selectionScriptPath
- A Path to a file containing a selection script, or null if
no script is needed.userName
- name of connected user that asked job creation, null otherwise. This parameter
is just used for default job's name creation.JobCreationException
- with a relevant error message if an error occurs.