Class TaskContextImpl

    • Method Detail

      • getId

        public int getId()
      • getContextName

        public String getContextName()
        Description copied from interface: TaskContext
        Get the context name.
        Specified by:
        getContextName in interface TaskContext
        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
      • 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
      • getContextCreationTime

        public long getContextCreationTime()
        Description copied from interface: TaskContext
        Get the creation time of the context.
        Specified by:
        getContextCreationTime in interface TaskContext
        Returns:
        the creation time of the context in milliseconds since epoch (1.1.1970)
      • getJarPathname

        public DataFile getJarPathname()
        Get the application jar path.
        Returns:
        Returns the jar path
      • getWorkflow

        public Workflow getWorkflow()
        Description copied from interface: TaskContext
        Get the workflow description
        Specified by:
        getWorkflow in interface TaskContext
        Returns:
        the workflow description
      • setContextName

        public void setContextName​(String contextName)
        Description copied from interface: TaskContext
        Set the context name.
        Specified by:
        setContextName in interface TaskContext
        Parameters:
        contextName - the name of the context
      • 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 interface TaskContext
        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 interface TaskContext
        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 interface TaskContext
        Parameters:
        portName - the name of the port
        dataName - 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 interface TaskContext
        Parameters:
        portName - the name of the port
        dataName - the name of the data
        part - 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 interface TaskContext
        Parameters:
        portName - the name of the port
        origin - 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 interface TaskContext
        Parameters:
        format - the DataFormat of the source
        dataName - 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 interface TaskContext
        Parameters:
        format - the DataFormat of the source
        dataName - the name of the data
        part - 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 interface TaskContext
        Parameters:
        format - the DataFormat of the source
        origin - origin of the new data
        Returns:
        a String with the pathname
      • 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