final class DirectedAcyclicGraph extends AnyRef
A directed acyclic graph. Every Pipeline is enforced into a DAG, so that data cannot flow in a loop. Stage's are nodes in this graph whereas edges represent data flow using a org.codefeedr.buffer.Buffer.
This class is immutable so that graph can be build in a functional manner:
val dag = new DirectedAcyclicGraph() .addNode(nodeOne) .addNode(nodeTwo) .addEdge(nodeOne, nodeTwo)
- Alphabetic
- By Inheritance
- DirectedAcyclicGraph
- 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
addEdge(from: AnyRef, to: AnyRef): DirectedAcyclicGraph
Adds an edge between two nodes in given graph.
Adds an edge between two nodes in given graph.
- from
The 'start' node.
- to
The 'end' node.
- returns
A new graph with the edge included
- Exceptions thrown
IllegalArgumentException
When either node is not in the graph or when the given edge causes a cycle.
-
def
addNode(node: AnyRef): DirectedAcyclicGraph
Add given node to the graph.
Add given node to the graph. Note: Nodes already in the graph will not be added again.
- node
Node to add.
- returns
A new graph with the node included.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
canReach(from: AnyRef, to: AnyRef): Boolean
Check whether there is a path from one node to the other.
Check whether there is a path from one node to the other.
- from
The 'from' node.
- to
The 'to' node.
- returns
true when there is a path.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- val edges: Vector[Edge]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(obj: Any): Boolean
Equality check for a DAG.
Equality check for a DAG.
- obj
Object to compare with.
- returns
True if equal.
- Definition Classes
- DirectedAcyclicGraph → AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
getChildren(node: AnyRef): Vector[AnyRef]
Get children of a node.
Get children of a node.
- node
Node to get children from.
- returns
A set with the children of the node. Note: can be the empty set.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getFirstParent(node: AnyRef): Option[AnyRef]
Get the parent that is designated as first/primary parent.
Get the parent that is designated as first/primary parent. This is the node which edges is found first.
- node
Node to get first/primary parent from.
- returns
The parent node. Note: Optional since the parent can be non-existing.
-
def
getParents(node: AnyRef): Vector[AnyRef]
Get a parents of a node.
Get a parents of a node.
- node
Node to get parents from.
- returns
A set with the parents of the node. Note: can be the empty set.
-
def
hasAnyEdge(node: AnyRef): Boolean
Check whether the node has any edge at all.
Check whether the node has any edge at all.
- node
The node to check.
- returns
True when it has more than zero edges.
-
def
hasEdge(from: AnyRef, to: AnyRef): Boolean
Check whether an edge exists between two nodes.
Check whether an edge exists between two nodes.
- from
The 'from' node.
- to
The 'to' node.
- returns
True when an edge from 'from' to 'to'.
-
def
hasNode(node: AnyRef): Boolean
Check whether given node is in the graph.
Check whether given node is in the graph.
- node
Node to verify.
- returns
True if in node is in graph.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isEmpty: Boolean
Check whether a graph is empty.
Check whether a graph is empty.
- returns
True when there are no nodes.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isSequential: Boolean
Check whether the graph is sequential.
Check whether the graph is sequential.
Sequential means that there is no node with multiple parents or children. The whole set of nodes is a connected line. An empty graph is also sequential.
- returns
True when the graph is sequential.
-
def
lastInSequence: Option[AnyRef]
Find the last node, assuming this graph is sequential.
Find the last node, assuming this graph is sequential.
- returns
The last node or None if the graph is not sequential or empty.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val nodes: Vector[AnyRef]
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
verify(): Unit
Verifies the graph.
Verifies the graph.
1) InputStages cannot have incoming edges. 2) OutputStages cannot have outgoing edges. 3) The input types of stage must be equal to the output types of its incoming edges.
- Exceptions thrown
InvalidPipelineException
if the pipeline is invalid (invalid edges).StageTypesIncompatibleException
if types within the pipeline are invalid.
-
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( ... )
-
def
withoutOrphans: DirectedAcyclicGraph
Get a copy of the graph with all orphans removed.
Get a copy of the graph with all orphans removed. Orphans are nodes without edges.
- returns
The graph without orphan nodes.