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 TaskContextImpl
deserialize(DataFile file)
Deserialize the TaskContext object.static TaskContextImpl
deserialize(File file)
Deserialize the TaskContext object.static TaskContextImpl
deserialize(InputStream in)
Deserialize the TaskContext object.void
deserializeOutputData(DataFile file)
Deserialize output data.void
deserializeOutputData(File file)
Deserialize output data.void
deserializeOutputData(InputStream in)
Deserialize output data.String
getCommandAuthor()
Get the command author.String
getCommandDescription()
Get command description.String
getCommandName()
Get the command name.long
getContextCreationTime()
Get the creation time of the context.String
getContextName()
Get the context name.Step
getCurrentStep()
Get the current step.DataFile
getDataRepositoryDirectory()
Get the data repository directory.DataFile
getDesignFile()
Get the design file path.fr.ens.biologie.genomique.kenetre.log.GenericLogger
getGenericLogger()
Get the generic logger.DataFile
getHadoopWorkingPathname()
Get the Hadoop working directory.int
getId()
Data
getInputData(InputPort port)
Get raw access to input data stored in the object.Data
getInputData(DataFormat format)
Get the input data for an input DataType and a Sample.Data
getInputData(String portName)
Get the input data for a port name and a Sample.DataFile
getJarPathname()
Get the application jar path.String
getJobDescription()
Get the job description.DataFile
getJobDirectory()
Get the job directory.String
getJobEnvironment()
Get the job environment.String
getJobHost()
Get the host of the job.String
getJobId()
Get the job id.String
getJobUUID()
Get the UUID of the job.File
getLocalTempDirectory()
Get local temporary directory.DataFile
getLocalWorkingPathname()
Get the local working directory.Logger
getLogger()
Get the logger.Data
getOutputData(DataFormat format, Data origin)
Get the output data for an input DataType and a Sample.Data
getOutputData(DataFormat format, String dataName)
Get the output data for an input DataType and a Sample.Data
getOutputData(DataFormat format, String dataName, int part)
Get the output data for an input DataType and a Sample.Data
getOutputData(String portName, Data origin)
Get the output data for a port name and a Sample.Data
getOutputData(String portName, String dataName)
Get the output data for a port name and a Sample.Data
getOutputData(String portName, String dataName, int part)
Get the output data for a port name and a Sample.DataFile
getOutputDirectory()
Get the output path.AbstractEoulsanRuntime
getRuntime()
Get EoulsanRuntime.Settings
getSettings()
Get Eoulsan settings.DataFile
getStepOutputDirectory()
Get the step working directory.String
getTaskFilePrefix()
Create the prefix of a related task file.DataFile
getTaskOutputDirectory()
Get the task output directory.Workflow
getWorkflow()
Get the workflow descriptionDataFile
getWorkflowFile()
Get the workflow file path.void
serialize(DataFile file)
Serialize the TaskContext object.void
serialize(File file)
Serialize the TaskContext object.void
serialize(OutputStream out)
Serialize the TaskContext object.void
serializeOutputData(DataFile file)
Serialize output data.void
serializeOutputData(File file)
Serialize output data.void
serializeOutputData(OutputStream out)
Serialize output data.void
setContextName(String contextName)
Set the context name.String
toString()
-
-
-
Method Detail
-
getId
public int getId()
-
getContextName
public String getContextName()
Description copied from interface:TaskContext
Get the context name.- Specified by:
getContextName
in 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:
getJobDirectory
in 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:StepConfigurationContext
Get the output path.- Specified by:
getOutputDirectory
in interfaceStepConfigurationContext
- Returns:
- Returns the output Path
-
getStepOutputDirectory
public DataFile getStepOutputDirectory()
Description copied from interface:StepConfigurationContext
Get the step working directory.- Specified by:
getStepOutputDirectory
in interfaceStepConfigurationContext
- Returns:
- Returns the step working directory
-
getJobId
public String getJobId()
Description copied from interface:StepConfigurationContext
Get the job id.- Specified by:
getJobId
in interfaceStepConfigurationContext
- Returns:
- the job id
-
getJobHost
public String getJobHost()
Description copied from interface:StepConfigurationContext
Get the host of the job.- Specified by:
getJobHost
in interfaceStepConfigurationContext
- Returns:
- a string with the host of the job
-
getContextCreationTime
public long getContextCreationTime()
Description copied from interface:TaskContext
Get the creation time of the context.- Specified by:
getContextCreationTime
in interfaceTaskContext
- Returns:
- the creation time of the context in milliseconds since epoch (1.1.1970)
-
getDesignFile
public DataFile getDesignFile()
Description copied from interface:StepConfigurationContext
Get the design file path.- Specified by:
getDesignFile
in interfaceStepConfigurationContext
- Returns:
- the design file path
-
getWorkflowFile
public DataFile getWorkflowFile()
Description copied from interface:StepConfigurationContext
Get the workflow file path.- Specified by:
getWorkflowFile
in 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:StepConfigurationContext
Get the UUID of the job.- Specified by:
getJobUUID
in interfaceStepConfigurationContext
- Returns:
- the job UUID
-
getJobDescription
public String getJobDescription()
Description copied from interface:StepConfigurationContext
Get the job description.- Specified by:
getJobDescription
in interfaceStepConfigurationContext
- Returns:
- the job description
-
getJobEnvironment
public String getJobEnvironment()
Description copied from interface:StepConfigurationContext
Get the job environment.- Specified by:
getJobEnvironment
in interfaceStepConfigurationContext
- Returns:
- the job environment
-
getCommandName
public String getCommandName()
Description copied from interface:StepConfigurationContext
Get the command name.- Specified by:
getCommandName
in interfaceStepConfigurationContext
- Returns:
- the command name
-
getCommandDescription
public String getCommandDescription()
Description copied from interface:StepConfigurationContext
Get command description.- Specified by:
getCommandDescription
in interfaceStepConfigurationContext
- Returns:
- the command description
-
getCommandAuthor
public String getCommandAuthor()
Description copied from interface:StepConfigurationContext
Get the command author.- Specified by:
getCommandAuthor
in interfaceStepConfigurationContext
- Returns:
- the command author
-
getWorkflow
public Workflow getWorkflow()
Description copied from interface:TaskContext
Get the workflow description- Specified by:
getWorkflow
in interfaceTaskContext
- Returns:
- the workflow description
-
getCurrentStep
public Step getCurrentStep()
Description copied from interface:StepConfigurationContext
Get the current step.- Specified by:
getCurrentStep
in interfaceStepConfigurationContext
- Returns:
- the current Step or null if no Step is currently running.
-
setContextName
public void setContextName(String contextName)
Description copied from interface:TaskContext
Set the context name.- Specified by:
setContextName
in interfaceTaskContext
- Parameters:
contextName
- the name of the context
-
getRuntime
public AbstractEoulsanRuntime getRuntime()
Description copied from interface:StepConfigurationContext
Get EoulsanRuntime.- Specified by:
getRuntime
in interfaceStepConfigurationContext
- Returns:
- the EoulsanRuntime
-
getSettings
public Settings getSettings()
Description copied from interface:StepConfigurationContext
Get Eoulsan settings.- Specified by:
getSettings
in interfaceStepConfigurationContext
- Returns:
- the Settings
-
getLogger
public Logger getLogger()
Description copied from interface:StepConfigurationContext
Get the logger.- Specified by:
getLogger
in interfaceStepConfigurationContext
- Returns:
- the logger
-
getGenericLogger
public fr.ens.biologie.genomique.kenetre.log.GenericLogger getGenericLogger()
Description copied from interface:StepConfigurationContext
Get the generic logger.- Specified by:
getGenericLogger
in interfaceStepConfigurationContext
- Returns:
- the generic logger
-
getInputData
public Data getInputData(String portName)
Description copied from interface:TaskContext
Get the input data for a port name and a Sample.- Specified by:
getInputData
in interfaceTaskContext
- Parameters:
portName
- the name of the port- Returns:
- a String with the pathname
-
getInputData
public Data getInputData(DataFormat format)
Description copied from interface:TaskContext
Get the input data for an input DataType and a Sample.- Specified by:
getInputData
in 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:TaskContext
Get the output data for a port name and a Sample.- Specified by:
getOutputData
in 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:TaskContext
Get the output data for a port name and a Sample.- Specified by:
getOutputData
in 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:TaskContext
Get the output data for a port name and a Sample.- Specified by:
getOutputData
in 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:TaskContext
Get the output data for an input DataType and a Sample.- Specified by:
getOutputData
in 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:TaskContext
Get the output data for an input DataType and a Sample.- Specified by:
getOutputData
in 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:TaskContext
Get the output data for an input DataType and a Sample.- Specified by:
getOutputData
in 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:StepConfigurationContext
Get local temporary directory.- Specified by:
getLocalTempDirectory
in 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
-
-