public class

Workflow

extends Object
java.lang.Object
   ↳ org.apache.helix.task.Workflow

Class Overview

Houses a job dag and config set to fully describe a job workflow

Summary

Nested Classes
class Workflow.Builder Build a workflow incrementally from dependencies and single configs, validate at build time  
Constants
String UNSPECIFIED Default workflow name, useful constant for single-node workflows
Public Methods
Map<StringMap<StringString>> getJobConfigs()
String getName()
Map<StringList<TaskConfig>> getTaskConfigs()
WorkflowConfig getWorkflowConfig()
static Workflow parse(InputStream inputStream)
Read a workflow from an open input stream
static Workflow parse(String yaml)
Parses a YAML description of the workflow into a Workflow object.
static Workflow parse(File file)
Parses the YAML description from a file into a Workflow object.
void validate()
Verifies that all nodes in provided dag have accompanying config and vice-versa.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String UNSPECIFIED

Default workflow name, useful constant for single-node workflows

Constant Value: "UNSPECIFIED"

Public Methods

public Map<StringMap<StringString>> getJobConfigs ()

public String getName ()

public Map<StringList<TaskConfig>> getTaskConfigs ()

public WorkflowConfig getWorkflowConfig ()

public static Workflow parse (InputStream inputStream)

Read a workflow from an open input stream

Parameters
inputStream the stream
Returns
  • Workflow

public static Workflow parse (String yaml)

Parses a YAML description of the workflow into a Workflow object. The YAML string is of the following form:

 name: MyFlow
 jobs:
   - name : JobA
     command : SomeTask
     ...
   - name : JobB
     parents : [JobA]
     command : SomeOtherTask
     ...
   - name : JobC
     command : AnotherTask
     ...
   - name : JobD
     parents : [JobB, JobC]
     command : AnotherTask
     ...
 

Parameters
yaml A YAML string of the above form
Returns
Throws
Exception

public static Workflow parse (File file)

Parses the YAML description from a file into a Workflow object.

Parameters
file An abstract path name to the file containing the workflow description.
Returns
Throws
Exception

public void validate ()

Verifies that all nodes in provided dag have accompanying config and vice-versa. Also checks dag for cycles and unreachable nodes, and ensures configs are valid.