Constructor and Description |
---|
DAGNode(String key,
DataT data)
Creates a DAG node.
|
Modifier and Type | Method and Description |
---|---|
void |
addDependency(String dependencyKey)
Mark the node identified by the given key as this node's dependency.
|
void |
addDependent(String key)
Mark the node identified by the given key as dependent of this node.
|
List<String> |
dependencyKeys() |
boolean |
hasDependencies() |
void |
initialize()
Initialize the node so that traversal can be performed on the parent DAG.
|
boolean |
isPreparer() |
ReentrantLock |
lock() |
protected void |
onFaultedResolution(String dependencyKey,
Throwable throwable)
Reports a dependency of this node has been faulted.
|
protected void |
onSuccessfulResolution(String dependencyKey)
Reports a dependency of this node has been successfully resolved.
|
void |
removeDependency(String dependencyKey)
Remove the dependency node identified by the given key from the dependencies.
|
void |
setPreparer(boolean isPreparer)
Mark or un-mark this node as preparer.
|
addChild, children, data, hasChildren, key, owner, removeChild, setOwner
public ReentrantLock lock()
public void addDependent(String key)
key
- the id of the dependent nodepublic List<String> dependencyKeys()
DAGraph
that this node depends onpublic void addDependency(String dependencyKey)
dependencyKey
- the id of the dependency nodepublic void removeDependency(String dependencyKey)
dependencyKey
- the id of the dependency nodepublic boolean hasDependencies()
public void setPreparer(boolean isPreparer)
isPreparer
- true if this node needs to be marked as preparer, false otherwise.public boolean isPreparer()
public void initialize()
protected void onSuccessfulResolution(String dependencyKey)
dependencyKey
- the id of the dependency nodeCopyright © 2019. All rights reserved.