class Graph extends AnyRef
A pipeline graph.
This is the fundamental API for constructing pipeline graphs. Once constructed, graphs can be executed with the com.jafpl.runtime.GraphRuntime.
Graphs are initially open, meaning that nodes and edges can be added to them, and !valid, meaning that no attempt has been made to validate them.
When all of the nodes and edges have been added to a graph, the graph is closed and validated by calling the close() method. Only valid graphs can be executed.
Generally speaking, steps are either atomic (in which case you're responsible for providing their implementation) or containers. Each may have an optional label. The labels have no purpose except clarity in error messages and in the graph diagrams. Labels must begin with a letter and may consist of letters, digits, hyphens, and underscores.
- Alphabetic
- By Inheritance
- Graph
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addAtomic(step: Step, label: Option[String]): Node
Adds an atomic step to the graph.
Adds an atomic step to the graph.
- step
The step implementation.
- label
An optional, user-defined label.
- returns
The constructed atomic.
- Attributes
- protected[com.jafpl.graph]
-
def
addBindingEdge(from: Binding, to: Node): Unit
Adds an edge from a variable binding to a step.
Adds an edge from a variable binding to a step.
- from
The variable binding.
- to
The step that should receive the binding.
-
def
addBindingEdge(varname: String, to: Node): Unit
Adds a binding edge from the in-scope binding for a variable.
Adds a binding edge from the in-scope binding for a variable.
- varname
The name of the variable.
- to
The step that should receive the binding.
-
def
addCatch(label: Option[String], codes: List[Any]): CatchStart
- Attributes
- protected[com.jafpl.graph]
-
def
addChoose(label: Option[String]): ChooseStart
Adds a choose to the graph.
Adds a choose to the graph.
- label
An optional, user-defined label.
- returns
The constructed choose.
- Attributes
- protected[com.jafpl.graph]
-
def
addDependsEdge(from: Node, to: Node): Unit
- Attributes
- protected[com.jafpl.graph]
-
def
addEdge(from: Node, fromName: String, to: Node, toName: String): Unit
Adds an edge between two nodes in the graph.
Adds an edge between two nodes in the graph.
An edge connects a specific output port on one step to a specific input port on another. Outputs can go to multiple inputs. Inputs can come from multiple outputs. (In the latter case, no guarantees about the order of the arrival of documents is made.)
The graph does not know what inputs steps expect or what outputs they provide. Any edges are allowed. If the actual edges do not correspond to the edges expected by the steps at runtime, errors or unexpected results may occur.
The following conditions are errors: 1. Crossing the graphs. Edges must be between nodes in the same graph. 1. Loops. No step may have an input directly or indirectly connected to one of its outputs. 1. Reading through walls. Steps inside a container may read from steps outside the container, but steps outside a container cannot "see" the steps inside a container directly. Instead, the inner steps must provide outputs through their container.
- from
The source node, the one that will be sending output.
- fromName
The name of the output port on the source node.
- to
The destination node, the one that will be receiving input.
- toName
The name of the input port on the destination node.
-
def
addEmptySource(): EmptySource
- Attributes
- protected[com.jafpl.graph]
-
def
addFinally(label: Option[String]): FinallyStart
- Attributes
- protected[com.jafpl.graph]
-
def
addFor(label: Option[String], countFrom: Long, countTo: Long, countBy: Long, manifold: ManifoldSpecification): LoopForStart
Adds a for-loop to the graph.
Adds a for-loop to the graph.
- label
An optional, user-defined label.
- returns
The constructed for-each.
- Attributes
- protected[com.jafpl.graph]
-
def
addForEach(label: Option[String], manifold: ManifoldSpecification): LoopEachStart
Adds a for-each to the graph.
Adds a for-each to the graph.
- label
An optional, user-defined label.
- returns
The constructed for-each.
- Attributes
- protected[com.jafpl.graph]
-
def
addGroup(label: Option[String], manifold: ManifoldSpecification): ContainerStart
Adds a group to the graph.
Adds a group to the graph.
- label
An optional, user-defined label.
- returns
The constructed group.
- Attributes
- protected[com.jafpl.graph]
-
def
addInput(node: Node, port: String): Unit
Adds a graph input.
Adds a graph input.
Graph inputs are values that must be provided at runtime. They're effectively ports into which data can be poured before the pipeline is run.
- node
The node that needs the input.
- port
The port that needs the input.
-
def
addJoiner(mode: JoinMode): Joiner
- Attributes
- protected[com.jafpl.graph]
-
def
addJoiner(): Joiner
- Attributes
- protected[com.jafpl.graph]
- def addOption(name: String, expression: Any, params: Option[BindingParams]): OptionBinding
-
def
addOption(name: String, expression: Any, params: BindingParams): OptionBinding
FIXME: WRITE THIS
FIXME: WRITE THIS
- name
The option name
- expression
The default initializer for the option
- returns
The binding
-
def
addOption(name: String, expression: Any): OptionBinding
FIXME: WRITE THIS
FIXME: WRITE THIS
- name
The option name
- expression
The default initializer for the option
- returns
The binding
- def addOrderedEdge(from: Node, fromName: String, to: Node, toName: String): Unit
-
def
addOutput(node: Node, port: String): Unit
Adds a graph output.
Adds a graph output.
Graph outputs are places where pipeline outputs can be poured.
- node
The node that will produce output.
- port
The port port on which it will produce.
-
def
addPipeline(label: Option[String], manifold: ManifoldSpecification): PipelineStart
Adds a pipeline to the graph.
Adds a pipeline to the graph.
- label
An optional, user-defined label.
- returns
The constructed Pipeline object.
-
def
addPipeline(label: String, manifold: ManifoldSpecification): PipelineStart
Adds a pipeline to the graph.
Adds a pipeline to the graph.
- label
A user-defined label.
- returns
The constructed Pipeline object.
-
def
addPipeline(manifold: ManifoldSpecification): PipelineStart
Adds a pipeline to the graph.
Adds a pipeline to the graph.
- returns
The constructed Pipeline object.
- def addPriorityEdge(from: Node, fromName: String, to: Node, toName: String): Unit
-
def
addSink(): Sink
- Attributes
- protected[com.jafpl.graph]
-
def
addSplitter(): Splitter
- Attributes
- protected[com.jafpl.graph]
-
def
addTry(label: Option[String]): TryStart
- Attributes
- protected[com.jafpl.graph]
-
def
addTryCatch(label: Option[String]): TryCatchStart
Adds a try/catch to the graph.
Adds a try/catch to the graph.
- label
An optional, user-defined label.
- returns
The constructed try/catch.
- Attributes
- protected[com.jafpl.graph]
-
def
addUntil(comparator: ItemComparator, returnAll: Boolean, label: Option[String], manifold: ManifoldSpecification): LoopUntilStart
Adds an until to the graph.
Adds an until to the graph.
- comparator
The comparator.
- label
An optional, user-defined label.
- returns
The constructed for-each.
- Attributes
- protected[com.jafpl.graph]
-
def
addVariable(name: String, expression: Any, params: BindingParams): Binding
- Attributes
- protected[com.jafpl.graph]
-
def
addVariable(name: String, expression: Any): Binding
- Attributes
- protected[com.jafpl.graph]
-
def
addViewport(composer: ViewportComposer, label: Option[String]): ViewportStart
Adds a viewport to the graph.
Adds a viewport to the graph.
- composer
The viewport composer.
- label
An optional, user-defined label.
- returns
The constructed viewport.
- Attributes
- protected[com.jafpl.graph]
-
def
addWhen(expression: Any, label: Option[String], manifold: ManifoldSpecification): WhenStart
- Attributes
- protected[com.jafpl.graph]
-
def
addWhile(tester: ItemTester, returnAll: Boolean, label: Option[String], manifold: ManifoldSpecification): LoopWhileStart
Adds a while to the graph.
Adds a while to the graph.
- tester
The test evaluator.
- label
An optional, user-defined label.
- returns
The constructed for-each.
- Attributes
- protected[com.jafpl.graph]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asXML: Elem
Return an XML representation of the graph.
Return an XML representation of the graph.
The graph is in the
http://jafpl.com/ns/graph
namespace. A RELAX NG schema is provided for the grammar. There is also a stylesheet that will transform the graph into an SVG diagram.- returns
A <graph> element containing a representation of the graph.
-
def
bindings(node: Node): Set[String]
- Attributes
- protected[com.jafpl]
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
close(): Unit
Close and validate the graph.
Close and validate the graph.
When a graph is closed, all of it's nodes and edges will be validated.
Closing the graph is transformative. New nodes will be added to the graph to ensure that: - Every output port is connected to a single input port. (Splitters will be added.) - Every input port is connected to a single output port. (Joiners will be added.) - If steps inside a loop read from steps outside a loop, a buffer will be added so that the second and subsequent iterations can (re)read the input.
If exceptions have occurred (or occur during the validation of the graph, the first such exception will be thrown. (All of the exceptions will be sent to the graph error listener, if there is one.)
* After a graph is closed, no changes can be made to it. * Only valid graphs can be executed.
-
def
commonAncestor(node1: Node, node2: Node): Option[Node]
- Attributes
- protected[com.jafpl.graph]
-
def
dump(): Unit
Dump all the graph objects to stdout.
- def dumpGraphTransitions: Boolean
- def dumpGraphTransitions_=(dump: Boolean): Unit
-
def
edges: List[Edge]
- Attributes
- protected[com.jafpl.graph]
-
def
edgesFrom(node: Node, port: String): List[Edge]
- Attributes
- protected[com.jafpl]
-
def
edgesFrom(node: Node): List[Edge]
- Attributes
- protected[com.jafpl]
-
def
edgesTo(node: Node, port: String): List[Edge]
- Attributes
- protected[com.jafpl]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
error(cause: Throwable): Unit
- Attributes
- protected[com.jafpl.graph]
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hasEdgeFrom(node: Node, port: String): Boolean
- Attributes
- protected[com.jafpl]
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
inboundPorts(node: Node): Set[String]
- Attributes
- protected[com.jafpl]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
logger: Logger
- Attributes
- protected[com.jafpl]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nodes: List[Node]
- Attributes
- protected[com.jafpl]
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
outboundPorts(node: Node): Set[String]
- Attributes
- protected[com.jafpl]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tnodes[T <: Node](implicit tag: ClassTag[T]): List[T]
- Attributes
- protected[com.jafpl]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def uid: Long
-
def
valid: Boolean
True if the graph is known to be valid.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
Just Another Fine Pipeline Language
This is a pipeline framework. It’s built on top of Akka actors to support arbitrary data flow pipelines. It is wholly agnostic to the kinds of data that flow through the pipelines and the implementations of the steps that process them.
See http://jafpl.com/ for more general information.