T - Type of Node/Task IDR - Type of Node/Task resultpublic interface DexecutorState<T,R> extends DependencyAware<T>
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 state| Modifier and Type | Method and Description |
|---|---|
void |
addErrored(ExecutionResult<T,R> task)
Add to errored collection
|
void |
decrementUnProcessedNodesCount()
decrements the count of total number of unprocessed nodes
|
int |
erroredCount() |
void |
forcedStop()
called to force stop
|
Phase |
getCurrentPhase() |
Collection<Node<T,R>> |
getDiscontinuedNodes() |
ExecutionResults<T,R> |
getErrored() |
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.
|
Set<Node<T,R>> |
getNonProcessedRootNodes() |
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
|
boolean |
isDiscontinuedNodesNotEmpty() |
void |
markDiscontinuedNodesProcessed()
clear (or marks) all the discontinued nodes till this point as processed
|
void |
markProcessingDone(Node<T,R> node) |
void |
onRecover()
called where Dexecutor is Recovered
|
void |
onTerminate()
called when Dexecutor is finished execution
|
void |
print(Traversar<T,R> traversar,
TraversarAction<T,R> action)
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 |
removeErrored(ExecutionResult<T,R> task)
Remove errored collection
|
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
|
addAsDependencyToAllInitialNodes, addAsDependentOnAllLeafNodes, addDependency, addIndependentNode<T,R> getGraphNode(T id)
id - The Unique node idint graphSize()
Set<Node<T,R>> getInitialNodes()
Set<Node<T,R>> getNonProcessedRootNodes()
void print(Traversar<T,R> traversar, TraversarAction<T,R> action)
traversar - would traverse the graphaction - callback which would be called based on traversevoid validate(Validator<T,R> validator)
validator - based on which validation would happenvoid setCurrentPhase(Phase currentPhase)
currentPhase - the phase that should be set toPhase getCurrentPhase()
int getUnProcessedNodesCount()
void incrementUnProcessedNodesCount()
void decrementUnProcessedNodesCount()
boolean shouldProcess(Node<T,R> node)
node - on which test should happennode should be processed by dexecutor or notvoid markProcessingDone(Node<T,R> node)
node - Mark the node as processed.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 - which should be processed after retry successvoid addErrored(ExecutionResult<T,R> task)
task - to add to errored collectionvoid removeErrored(ExecutionResult<T,R> task)
task - to remove from errored collectionint erroredCount()
ExecutionResults<T,R> getErrored()
void forcedStop()
void onTerminate()
void onRecover()
Copyright © 2016–2018 Dexecutor. All rights reserved.