T
- Type of Node/Task IDR
- Type of Node/Task resultpublic interface DexecutorState<T extends Comparable<T>,R>
Phase :
Current Phase Dexecutor is inGraph :
Exposes API around building graph unprocessed nodes count :
How many nodes are waiting to be processedprocessed nodes :
Nodes which are processed till that pointDiscontinued nodes :
Nodes for which processing should continue after system comes to valid stateModifier and Type | Method and Description |
---|---|
void |
addAsDependencyToAllInitialNodes(T nodeValue)
Adds the node as dependency to all initial nodes (at the time of adding), meaning this given node would be evaluated first and then all initial nodes would run in parallel
|
void |
addAsDependentOnAllLeafNodes(T nodeValue)
Adds the node as dependent on all leaf nodes (at the time of adding), meaning all leaf nodes would be evaluated first and then the given node
|
void |
addDependency(T evalFirstValue,
T evalAfterValue)
Add Two dependent nodes into the graph, creating the nodes if not already present
|
void |
addIndependent(T nodeValue)
Add a node as independent, it does not require any dependent node
|
void |
decrementUnProcessedNodesCount()
decrements the count of total number of unprocessed nodes
|
Phase |
getCurrentPhase() |
Collection<Node<T,R>> |
getDiscontinuedNodes() |
Node<T,R> |
getGraphNode(T id)
Returns the node with the given id
|
Set<Node<T,R>> |
getInitialNodes()
Returns the Set of nodes for which there is no incoming dependencies.
|
Collection<Node<T,R>> |
getProcessedNodes() |
int |
getUnProcessedNodesCount() |
int |
graphSize()
Returns the total number of nodes in this graph
|
void |
incrementUnProcessedNodesCount()
increments the count of total number of unprocessed nodes
|
void |
initState()
Initialize the Dexecutor state, either to new or existing state
|
boolean |
isDiscontinuedNodesNotEmpty() |
void |
markDiscontinuedNodesProcessed()
clear (or marks) all the discontinued nodes till this point as processed
|
void |
markProcessingDone(Node<T,R> node)
Mark the
node as processed. |
void |
print(Traversar<T,R> traversar,
Writer writer)
Prints the graph into the writer using the Traversar
|
void |
processAfterNoError(Collection<Node<T,R>> nodes)
Add to existing collection of discontinued nodes to be processed later, if system come to valid state.
|
void |
setCurrentPhase(Phase currentPhase)
sets the phase to that of provided
|
boolean |
shouldProcess(Node<T,R> node) |
void |
validate(Validator<T,R> validator)
validates the graph using the validator
|
void initState()
void addIndependent(T nodeValue)
nodeValue
- void addDependency(T evalFirstValue, T evalAfterValue)
Add Two dependent nodes into the graph, creating the nodes if not already present
evalFirstValue
would be executed first and then evalAfterValue
evalFirstValue
- evalAfterValue
- void addAsDependentOnAllLeafNodes(T nodeValue)
nodeValue
- void addAsDependencyToAllInitialNodes(T nodeValue)
nodeValue
- Set<Node<T,R>> getInitialNodes()
Node<T,R> getGraphNode(T id)
id
- int graphSize()
void print(Traversar<T,R> traversar, Writer writer)
traversar
- writer
- void validate(Validator<T,R> validator)
validator
- void setCurrentPhase(Phase currentPhase)
currentPhase
- Phase getCurrentPhase()
int getUnProcessedNodesCount()
void incrementUnProcessedNodesCount()
void decrementUnProcessedNodesCount()
boolean shouldProcess(Node<T,R> node)
node
- node
should be processed by dexecutor or notvoid markProcessingDone(Node<T,R> node)
node
as processed.node
- Collection<Node<T,R>> getProcessedNodes()
boolean isDiscontinuedNodesNotEmpty()
true
if there nodes that should be processed, if some were discontinued due to error.
false
otherwiseCollection<Node<T,R>> getDiscontinuedNodes()
void markDiscontinuedNodesProcessed()
void processAfterNoError(Collection<Node<T,R>> nodes)
nodes
- Copyright © 2016 Dexecutor. All rights reserved.