Class PiperContext

java.lang.Object
com.atgenomix.seqslab.piper.plugin.api.PiperContext
All Implemented Interfaces:
Serializable

public abstract class PiperContext extends Object implements Serializable
An object used in all operations of a workflow task execution. It represents a persistent set of properties, including Spark session, pipeline configurations, and environment context. A piper context object is first created when a workflow task is requested and then used to lazily initialize all registered SeqsLab PiperPlugin, each of which returns its PluginContext in order to later initialize its invoked pipeline Operator.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    org.apache.spark.sql.SparkSession
    An entry point for operators to work with DataFrame and Dataset.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    PiperContext(org.apache.spark.sql.SparkSession spark, Pipeline pipeline)
    Creates a context object with the specified Spark session and pipeline configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the information of execution environment and configuration.
    Obtain the dataset object value of an input variable identified by fully-qualified name.
    Obtain the pipeline task of an input or output variable identified by fully-qualified name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • spark

      public org.apache.spark.sql.SparkSession spark
      An entry point for operators to work with DataFrame and Dataset.
  • Constructor Details

    • PiperContext

      protected PiperContext(org.apache.spark.sql.SparkSession spark, Pipeline pipeline)
      Creates a context object with the specified Spark session and pipeline configuration.
      Parameters:
      spark - Spark session for operators to work with DataFrame and Dataset.
      pipeline - A persistent configuration of a workflow task request.
  • Method Details

    • getConf

      public Map<String,String> getConf()
      Get the information of execution environment and configuration.
      Returns:
      A map of NamedValue properties
    • getDataset

      public PiperValue getDataset(String fqn)
      Obtain the dataset object value of an input variable identified by fully-qualified name.
      Parameters:
      fqn - The fully-qualified name of an input variable, e.g. myworkflow.task.ref.
      Returns:
      The dataset object value or null if not found.
    • getTask

      public PipelineTask getTask(String fqn)
      Obtain the pipeline task of an input or output variable identified by fully-qualified name.
      Parameters:
      fqn - The fully-qualified name of an input or output variable, e.g. myworkflow.task.fastqR1.
      Returns:
      The pipeline task object or null if not found.