public class DefaultDexecutorState<T extends Comparable<T>,R> extends Object implements DexecutorState<T,R>
| Constructor and Description |
|---|
DefaultDexecutorState() |
| Modifier 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
|
public void initState()
DexecutorStateinitState in interface DexecutorState<T extends Comparable<T>,R>public void addIndependent(T nodeValue)
DexecutorStateaddIndependent in interface DexecutorState<T extends Comparable<T>,R>public void addDependency(T evalFirstValue, T evalAfterValue)
DexecutorStateAdd Two dependent nodes into the graph, creating the nodes if not already present
evalFirstValue would be executed first and then evalAfterValue
addDependency in interface DexecutorState<T extends Comparable<T>,R>public void addAsDependentOnAllLeafNodes(T nodeValue)
DexecutorStateaddAsDependentOnAllLeafNodes in interface DexecutorState<T extends Comparable<T>,R>public void addAsDependencyToAllInitialNodes(T nodeValue)
DexecutorStateaddAsDependencyToAllInitialNodes in interface DexecutorState<T extends Comparable<T>,R>public void setCurrentPhase(Phase currentPhase)
DexecutorStatesetCurrentPhase in interface DexecutorState<T extends Comparable<T>,R>public Phase getCurrentPhase()
getCurrentPhase in interface DexecutorState<T extends Comparable<T>,R>public Set<Node<T,R>> getInitialNodes()
DexecutorStategetInitialNodes in interface DexecutorState<T extends Comparable<T>,R>public int graphSize()
DexecutorStategraphSize in interface DexecutorState<T extends Comparable<T>,R>public Node<T,R> getGraphNode(T id)
DexecutorStategetGraphNode in interface DexecutorState<T extends Comparable<T>,R>public void incrementUnProcessedNodesCount()
DexecutorStateincrementUnProcessedNodesCount in interface DexecutorState<T extends Comparable<T>,R>public void decrementUnProcessedNodesCount()
DexecutorStatedecrementUnProcessedNodesCount in interface DexecutorState<T extends Comparable<T>,R>public int getUnProcessedNodesCount()
getUnProcessedNodesCount in interface DexecutorState<T extends Comparable<T>,R>public boolean shouldProcess(Node<T,R> node)
shouldProcess in interface DexecutorState<T extends Comparable<T>,R>node should be processed by dexecutor or notpublic void markProcessingDone(Node<T,R> node)
DexecutorStatenode as processed.markProcessingDone in interface DexecutorState<T extends Comparable<T>,R>public Collection<Node<T,R>> getProcessedNodes()
getProcessedNodes in interface DexecutorState<T extends Comparable<T>,R>public boolean isDiscontinuedNodesNotEmpty()
isDiscontinuedNodesNotEmpty in interface DexecutorState<T extends Comparable<T>,R>true if there nodes that should be processed, if some were discontinued due to error.
false otherwisepublic Collection<Node<T,R>> getDiscontinuedNodes()
getDiscontinuedNodes in interface DexecutorState<T extends Comparable<T>,R>public void markDiscontinuedNodesProcessed()
DexecutorStatemarkDiscontinuedNodesProcessed in interface DexecutorState<T extends Comparable<T>,R>public void processAfterNoError(Collection<Node<T,R>> nodes)
DexecutorStateprocessAfterNoError in interface DexecutorState<T extends Comparable<T>,R>public void print(Traversar<T,R> traversar, Writer writer)
DexecutorStateprint in interface DexecutorState<T extends Comparable<T>,R>public void validate(Validator<T,R> validator)
DexecutorStatevalidate in interface DexecutorState<T extends Comparable<T>,R>Copyright © 2016 Dexecutor. All rights reserved.