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
The type representing node in a
DAGraph.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDependency(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.Gets a list of keys of nodes in DAGraph that this node depends on.booleanCheck whether this node has any dependency.voidInitialize the node so that traversal can be performed on the parent DAG.booleanCheck whether this node is marked as preparer.lock()Gets the lock to be used while performing thread safe operation on this node.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
-
Constructor Details
-
DAGNode
Creates a DAG node.- Parameters:
key- unique id of the nodedata- data to be stored in the node
-
-
Method Details
-
lock
Gets the lock to be used while performing thread safe operation on this node.- Returns:
- the lock to be used while performing thread safe operation on this node.
-
addDependent
Mark the node identified by the given key as dependent of this node.- Parameters:
key- the id of the dependent node
-
dependencyKeys
Gets a list of keys of nodes in DAGraph that this node depends on.- Returns:
- a list of keys of nodes in
DAGraphthat this node depends on
-
addDependency
Mark the node identified by the given key as this node's dependency.- Parameters:
dependencyKey- the id of the dependency node
-
removeDependency
Remove the dependency node identified by the given key from the dependencies.- Parameters:
dependencyKey- the id of the dependency node
-
hasDependencies
public boolean hasDependencies()Check whether this node has any dependency.- 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()Check whether this node is marked as preparer.- 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
Reports a dependency of this node has been successfully resolved.- Parameters:
dependencyKey- the id of the dependency node
-
onFaultedResolution
Reports a dependency of this node has been faulted.- Parameters:
dependencyKey- the id of the dependency nodethrowable- the reason for unsuccessful resolution
-