Class TaskContextImpl
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.core.workflow.TaskContextImpl
-
- All Implemented Interfaces:
StepConfigurationContext,TaskContext,Serializable
public class TaskContextImpl extends Object implements TaskContext, Serializable
This class define a task context.- Since:
- 2.0
- Author:
- Laurent Jourdren
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TaskContextImpldeserialize(DataFile file)Deserialize the TaskContext object.static TaskContextImpldeserialize(File file)Deserialize the TaskContext object.static TaskContextImpldeserialize(InputStream in)Deserialize the TaskContext object.voiddeserializeOutputData(DataFile file)Deserialize output data.voiddeserializeOutputData(File file)Deserialize output data.voiddeserializeOutputData(InputStream in)Deserialize output data.StringgetCommandAuthor()Get the command author.StringgetCommandDescription()Get command description.StringgetCommandName()Get the command name.longgetContextCreationTime()Get the creation time of the context.StringgetContextName()Get the context name.StepgetCurrentStep()Get the current step.DataFilegetDataRepositoryDirectory()Get the data repository directory.DataFilegetDesignFile()Get the design file path.fr.ens.biologie.genomique.kenetre.log.GenericLoggergetGenericLogger()Get the generic logger.DataFilegetHadoopWorkingPathname()Get the Hadoop working directory.intgetId()DatagetInputData(InputPort port)Get raw access to input data stored in the object.DatagetInputData(DataFormat format)Get the input data for an input DataType and a Sample.DatagetInputData(String portName)Get the input data for a port name and a Sample.DataFilegetJarPathname()Get the application jar path.StringgetJobDescription()Get the job description.DataFilegetJobDirectory()Get the job directory.StringgetJobEnvironment()Get the job environment.StringgetJobHost()Get the host of the job.StringgetJobId()Get the job id.StringgetJobUUID()Get the UUID of the job.FilegetLocalTempDirectory()Get local temporary directory.DataFilegetLocalWorkingPathname()Get the local working directory.LoggergetLogger()Get the logger.DatagetOutputData(DataFormat format, Data origin)Get the output data for an input DataType and a Sample.DatagetOutputData(DataFormat format, String dataName)Get the output data for an input DataType and a Sample.DatagetOutputData(DataFormat format, String dataName, int part)Get the output data for an input DataType and a Sample.DatagetOutputData(String portName, Data origin)Get the output data for a port name and a Sample.DatagetOutputData(String portName, String dataName)Get the output data for a port name and a Sample.DatagetOutputData(String portName, String dataName, int part)Get the output data for a port name and a Sample.DataFilegetOutputDirectory()Get the output path.AbstractEoulsanRuntimegetRuntime()Get EoulsanRuntime.SettingsgetSettings()Get Eoulsan settings.DataFilegetStepOutputDirectory()Get the step working directory.StringgetTaskFilePrefix()Create the prefix of a related task file.DataFilegetTaskOutputDirectory()Get the task output directory.WorkflowgetWorkflow()Get the workflow descriptionDataFilegetWorkflowFile()Get the workflow file path.voidserialize(DataFile file)Serialize the TaskContext object.voidserialize(File file)Serialize the TaskContext object.voidserialize(OutputStream out)Serialize the TaskContext object.voidserializeOutputData(DataFile file)Serialize output data.voidserializeOutputData(File file)Serialize output data.voidserializeOutputData(OutputStream out)Serialize output data.voidsetContextName(String contextName)Set the context name.StringtoString()
-
-
-
Method Detail
-
getId
public int getId()
-
getContextName
public String getContextName()
Description copied from interface:TaskContextGet the context name.- Specified by:
getContextNamein interfaceTaskContext- Returns:
- a String with the context name
-
getLocalWorkingPathname
public DataFile getLocalWorkingPathname()
Get the local working directory.- Returns:
- Returns the local working directory
-
getHadoopWorkingPathname
public DataFile getHadoopWorkingPathname()
Get the Hadoop working directory.- Returns:
- Returns the Hadoop working directory
-
getJobDirectory
public DataFile getJobDirectory()
Get the job directory.- Specified by:
getJobDirectoryin interfaceStepConfigurationContext- Returns:
- Returns the job directory
-
getTaskOutputDirectory
public DataFile getTaskOutputDirectory()
Get the task output directory.- Returns:
- Returns the task output directory
-
getDataRepositoryDirectory
public DataFile getDataRepositoryDirectory()
Get the data repository directory.- Returns:
- Returns the data repository directory
-
getOutputDirectory
public DataFile getOutputDirectory()
Description copied from interface:StepConfigurationContextGet the output path.- Specified by:
getOutputDirectoryin interfaceStepConfigurationContext- Returns:
- Returns the output Path
-
getStepOutputDirectory
public DataFile getStepOutputDirectory()
Description copied from interface:StepConfigurationContextGet the step working directory.- Specified by:
getStepOutputDirectoryin interfaceStepConfigurationContext- Returns:
- Returns the step working directory
-
getJobId
public String getJobId()
Description copied from interface:StepConfigurationContextGet the job id.- Specified by:
getJobIdin interfaceStepConfigurationContext- Returns:
- the job id
-
getJobHost
public String getJobHost()
Description copied from interface:StepConfigurationContextGet the host of the job.- Specified by:
getJobHostin interfaceStepConfigurationContext- Returns:
- a string with the host of the job
-
getContextCreationTime
public long getContextCreationTime()
Description copied from interface:TaskContextGet the creation time of the context.- Specified by:
getContextCreationTimein interfaceTaskContext- Returns:
- the creation time of the context in milliseconds since epoch (1.1.1970)
-
getDesignFile
public DataFile getDesignFile()
Description copied from interface:StepConfigurationContextGet the design file path.- Specified by:
getDesignFilein interfaceStepConfigurationContext- Returns:
- the design file path
-
getWorkflowFile
public DataFile getWorkflowFile()
Description copied from interface:StepConfigurationContextGet the workflow file path.- Specified by:
getWorkflowFilein interfaceStepConfigurationContext- Returns:
- the workflow file path
-
getJarPathname
public DataFile getJarPathname()
Get the application jar path.- Returns:
- Returns the jar path
-
getJobUUID
public String getJobUUID()
Description copied from interface:StepConfigurationContextGet the UUID of the job.- Specified by:
getJobUUIDin interfaceStepConfigurationContext- Returns:
- the job UUID
-
getJobDescription
public String getJobDescription()
Description copied from interface:StepConfigurationContextGet the job description.- Specified by:
getJobDescriptionin interfaceStepConfigurationContext- Returns:
- the job description
-
getJobEnvironment
public String getJobEnvironment()
Description copied from interface:StepConfigurationContextGet the job environment.- Specified by:
getJobEnvironmentin interfaceStepConfigurationContext- Returns:
- the job environment
-
getCommandName
public String getCommandName()
Description copied from interface:StepConfigurationContextGet the command name.- Specified by:
getCommandNamein interfaceStepConfigurationContext- Returns:
- the command name
-
getCommandDescription
public String getCommandDescription()
Description copied from interface:StepConfigurationContextGet command description.- Specified by:
getCommandDescriptionin interfaceStepConfigurationContext- Returns:
- the command description
-
getCommandAuthor
public String getCommandAuthor()
Description copied from interface:StepConfigurationContextGet the command author.- Specified by:
getCommandAuthorin interfaceStepConfigurationContext- Returns:
- the command author
-
getWorkflow
public Workflow getWorkflow()
Description copied from interface:TaskContextGet the workflow description- Specified by:
getWorkflowin interfaceTaskContext- Returns:
- the workflow description
-
getCurrentStep
public Step getCurrentStep()
Description copied from interface:StepConfigurationContextGet the current step.- Specified by:
getCurrentStepin interfaceStepConfigurationContext- Returns:
- the current Step or null if no Step is currently running.
-
setContextName
public void setContextName(String contextName)
Description copied from interface:TaskContextSet the context name.- Specified by:
setContextNamein interfaceTaskContext- Parameters:
contextName- the name of the context
-
getRuntime
public AbstractEoulsanRuntime getRuntime()
Description copied from interface:StepConfigurationContextGet EoulsanRuntime.- Specified by:
getRuntimein interfaceStepConfigurationContext- Returns:
- the EoulsanRuntime
-
getSettings
public Settings getSettings()
Description copied from interface:StepConfigurationContextGet Eoulsan settings.- Specified by:
getSettingsin interfaceStepConfigurationContext- Returns:
- the Settings
-
getLogger
public Logger getLogger()
Description copied from interface:StepConfigurationContextGet the logger.- Specified by:
getLoggerin interfaceStepConfigurationContext- Returns:
- the logger
-
getGenericLogger
public fr.ens.biologie.genomique.kenetre.log.GenericLogger getGenericLogger()
Description copied from interface:StepConfigurationContextGet the generic logger.- Specified by:
getGenericLoggerin interfaceStepConfigurationContext- Returns:
- the generic logger
-
getInputData
public Data getInputData(String portName)
Description copied from interface:TaskContextGet the input data for a port name and a Sample.- Specified by:
getInputDatain interfaceTaskContext- Parameters:
portName- the name of the port- Returns:
- a String with the pathname
-
getInputData
public Data getInputData(DataFormat format)
Description copied from interface:TaskContextGet the input data for an input DataType and a Sample.- Specified by:
getInputDatain interfaceTaskContext- Parameters:
format- the DataFormat of the source- Returns:
- a String with the pathname
-
getOutputData
public Data getOutputData(String portName, String dataName)
Description copied from interface:TaskContextGet the output data for a port name and a Sample.- Specified by:
getOutputDatain interfaceTaskContext- Parameters:
portName- the name of the portdataName- the name of the data- Returns:
- a String with the pathname
-
getOutputData
public Data getOutputData(String portName, String dataName, int part)
Description copied from interface:TaskContextGet the output data for a port name and a Sample.- Specified by:
getOutputDatain interfaceTaskContext- Parameters:
portName- the name of the portdataName- the name of the datapart- data part- Returns:
- a String with the pathname
-
getOutputData
public Data getOutputData(String portName, Data origin)
Description copied from interface:TaskContextGet the output data for a port name and a Sample.- Specified by:
getOutputDatain interfaceTaskContext- Parameters:
portName- the name of the portorigin- origin of the new data- Returns:
- a String with the pathname
-
getOutputData
public Data getOutputData(DataFormat format, String dataName)
Description copied from interface:TaskContextGet the output data for an input DataType and a Sample.- Specified by:
getOutputDatain interfaceTaskContext- Parameters:
format- the DataFormat of the sourcedataName- the name of the data- Returns:
- a String with the pathname
-
getOutputData
public Data getOutputData(DataFormat format, String dataName, int part)
Description copied from interface:TaskContextGet the output data for an input DataType and a Sample.- Specified by:
getOutputDatain interfaceTaskContext- Parameters:
format- the DataFormat of the sourcedataName- the name of the datapart- data part- Returns:
- a String with the pathname
-
getOutputData
public Data getOutputData(DataFormat format, Data origin)
Description copied from interface:TaskContextGet the output data for an input DataType and a Sample.- Specified by:
getOutputDatain interfaceTaskContext- Parameters:
format- the DataFormat of the sourceorigin- origin of the new data- Returns:
- a String with the pathname
-
getLocalTempDirectory
public File getLocalTempDirectory()
Description copied from interface:StepConfigurationContextGet local temporary directory.- Specified by:
getLocalTempDirectoryin interfaceStepConfigurationContext- Returns:
- the local temporary directory
-
getTaskFilePrefix
public String getTaskFilePrefix()
Create the prefix of a related task file.- Returns:
- a string with the prefix of the task file
-
getInputData
public Data getInputData(InputPort port)
Get raw access to input data stored in the object.- Parameters:
port- name of the input port- Returns:
- a Data object
-
serialize
public void serialize(File file) throws IOException
Serialize the TaskContext object.- Parameters:
file- output DataFile- Throws:
IOException- if an error occurs while creating the file
-
serialize
public void serialize(DataFile file) throws IOException
Serialize the TaskContext object.- Parameters:
file- output DataFile- Throws:
IOException- if an error occurs while creating the file
-
serialize
public void serialize(OutputStream out) throws IOException
Serialize the TaskContext object.- Parameters:
out- output stream- Throws:
IOException- if an error occurs while creating the file
-
deserialize
public static TaskContextImpl deserialize(File file) throws IOException
Deserialize the TaskContext object. Warning: this method update the values of the settings of the Eoulsan runtime.- Parameters:
file- input DataFile- Throws:
IOException- if an error occurs while reading the file
-
deserialize
public static TaskContextImpl deserialize(DataFile file) throws IOException
Deserialize the TaskContext object. Warning: this method update the values of the settings of the Eoulsan runtime.- Parameters:
file- input DataFile- Throws:
IOException- if an error occurs while reading the file
-
deserialize
public static TaskContextImpl deserialize(InputStream in) throws IOException
Deserialize the TaskContext object. Warning: this method update the values of the settings of the Eoulsan runtime.- Parameters:
in- input stream- Throws:
IOException- if an error occurs while reading the file
-
serializeOutputData
public void serializeOutputData(File file) throws IOException
Serialize output data.- Parameters:
file- output file- Throws:
IOException- if an error occurs while creating the file
-
serializeOutputData
public void serializeOutputData(DataFile file) throws IOException
Serialize output data.- Parameters:
file- output DataFile- Throws:
IOException- if an error occurs while creating the file
-
serializeOutputData
public void serializeOutputData(OutputStream out) throws IOException
Serialize output data.- Parameters:
out- output stream- Throws:
IOException- if an error occurs while creating the file
-
deserializeOutputData
public void deserializeOutputData(DataFile file) throws IOException
Deserialize output data.- Parameters:
file- input datafile- Throws:
IOException- if an error occurs while reading the file
-
deserializeOutputData
public void deserializeOutputData(File file) throws IOException
Deserialize output data.- Parameters:
file- input file- Throws:
IOException- if an error occurs while reading the file
-
deserializeOutputData
public void deserializeOutputData(InputStream in) throws IOException
Deserialize output data.- Parameters:
in- input stream- Throws:
IOException- if an error occurs while reading the file
-
-