DAGraph<DataT,NodeT,NodeT> Class
- java.
lang. Object - Graph<DataT,NodeT,NodeT>
- com.
microsoft. azure. management. resources. fluentcore. dag. DAGraph<DataT,NodeT,NodeT>
- com.
Type Parameters
- DataT
the type of the data stored in the graph nodes
- NodeT
the type of the nodes in the graph
- NodeT
the type of the nodes in the graph
public class DAGraph<DataT,NodeT extends DAGNode<DataT,NodeT>> extends Graph<DataT, NodeT>
Type representing a DAG (directed acyclic graph).
each node in a DAG is represented by DAGNode<DataT,NodeT>
Constructor Summary
Constructor | Description |
---|---|
DAGraph(NodeT rootNode) |
Creates a new DAG. |
Method Summary
Modifier and Type | Method and Description |
---|---|
NodeT |
getNext()
Gets next node in the DAG which has no dependency or all of it's dependencies are resolved and ready to be consumed. |
NodeT |
getNode(String key)
Gets a node from the graph with the given key. |
boolean | hasParent() |
boolean | isPreparer() |
boolean |
isRootNode(NodeT node)
Checks whether the given node is root node of this DAG. |
void |
merge(DAGraph<DataT, NodeT> parent)
Merge this DAG with another DAG. This will mark this DAG as a child DAG, the dependencies of nodes in this DAG will be merged with (copied to) the parent DAG |
void |
mergeChildToParent(String parentKey, NodeT childNode)
Merges DAG associated with childNode to DAG associated with a parent node of given key. |
void |
prepare()
Prepares this DAG for traversal using getNext method, each call to getNext returns next node in the DAG with no dependencies. |
void |
reportCompletion(NodeT completed)
Reports that a node is resolved hence other nodes depends on it can consume it. |
void |
reportError(NodeT faulted, Throwable throwable)
Reports that a node is faulted. |
Inherited Members
Constructor Details
DAGraph
public DAGraph(NodeT rootNode)
Creates a new DAG.
Parameters:
Method Details
getNext
public NodeT getNext()
Gets next node in the DAG which has no dependency or all of it's dependencies are resolved and ready to be consumed.
Returns:
getNode
public NodeT getNode(String key)
Gets a node from the graph with the given key.
Parameters:
Returns:
hasParent
public boolean hasParent()
Returns:
true
if this DAG is merged with another DAG and hence has a parent
isPreparer
public boolean isPreparer()
Returns:
true
if this dag is the preparer responsible for preparing the DAG for traversal.
isRootNode
public boolean isRootNode(NodeT node)
Checks whether the given node is root node of this DAG.
Parameters:
Returns:
true
if the given node is root node
merge
public void merge(DAGraph
Merge this DAG with another DAG.
This will mark this DAG as a child DAG, the dependencies of nodes in this DAG will be merged with (copied to) the parent DAG
Parameters:
mergeChildToParent
public void mergeChildToParent(String parentKey, NodeT childNode)
Merges DAG associated with childNode to DAG associated with a parent node of given key.
Parameters:
prepare
public void prepare()
Prepares this DAG for traversal using getNext method, each call to getNext returns next node in the DAG with no dependencies.
reportCompletion
public void reportCompletion(NodeT completed)
Reports that a node is resolved hence other nodes depends on it can consume it.
Parameters:
reportError
public void reportError(NodeT faulted, Throwable throwable)
Reports that a node is faulted.
Parameters:
Applies to
Azure SDK for Java