Class DAGNode<DataT,NodeT extends DAGNode<DataT,NodeT>>
- java.lang.Object
-
- com.azure.resourcemanager.resources.fluentcore.dag.Node<DataT,NodeT>
-
- com.azure.resourcemanager.resources.fluentcore.dag.DAGNode<DataT,NodeT>
-
- Type Parameters:
DataT- the type of the data stored in the nodeNodeT- the type of the node
- Direct Known Subclasses:
TaskGroupEntry
public class DAGNode<DataT,NodeT extends DAGNode<DataT,NodeT>> extends Node<DataT,NodeT>
The type representing node in aDAGraph.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDependency(String dependencyKey)Mark the node identified by the given key as this node's dependency.voidaddDependent(String key)Mark the node identified by the given key as dependent of this node.List<String>dependencyKeys()booleanhasDependencies()voidinitialize()Initialize the node so that traversal can be performed on the parent DAG.booleanisPreparer()ReentrantLocklock()protected voidonFaultedResolution(String dependencyKey, Throwable throwable)Reports a dependency of this node has been faulted.protected voidonSuccessfulResolution(String dependencyKey)Reports a dependency of this node has been successfully resolved.voidremoveDependency(String dependencyKey)Remove the dependency node identified by the given key from the dependencies.voidsetPreparer(boolean isPreparer)Mark or un-mark this node as preparer.-
Methods inherited from class com.azure.resourcemanager.resources.fluentcore.dag.Node
addChild, children, data, hasChildren, key, owner, removeChild, setOwner
-
-
-
-
Method Detail
-
lock
public ReentrantLock lock()
- Returns:
- the lock to be used while performing thread safe operation on this node.
-
addDependent
public void addDependent(String key)
Mark the node identified by the given key as dependent of this node.- Parameters:
key- the id of the dependent node
-
dependencyKeys
public List<String> dependencyKeys()
- Returns:
- a list of keys of nodes in
DAGraphthat this node depends on
-
addDependency
public void addDependency(String dependencyKey)
Mark the node identified by the given key as this node's dependency.- Parameters:
dependencyKey- the id of the dependency node
-
removeDependency
public void removeDependency(String dependencyKey)
Remove the dependency node identified by the given key from the dependencies.- Parameters:
dependencyKey- the id of the dependency node
-
hasDependencies
public boolean hasDependencies()
- Returns:
- true if this node has any dependency
-
setPreparer
public void setPreparer(boolean isPreparer)
Mark or un-mark this node as preparer.- Parameters:
isPreparer- true if this node needs to be marked as preparer, false otherwise.
-
isPreparer
public boolean isPreparer()
- Returns:
- true if this node is marked as preparer
-
initialize
public void initialize()
Initialize the node so that traversal can be performed on the parent DAG.
-
onSuccessfulResolution
protected void onSuccessfulResolution(String dependencyKey)
Reports a dependency of this node has been successfully resolved.- Parameters:
dependencyKey- the id of the dependency node
-
-