T
- Type of Node/Task IDR
- Type of Node/Task resultpublic interface DexecutorState<T extends Comparable<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 stateModifier and Type | Method and Description |
---|---|
void |
addErrored(T id)
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() |
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 |
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(T id)
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, addIndependent
Node<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(T id)
id
- id to add to errored collectionvoid removeErrored(T id)
id
- to remove from errored collectionint erroredCount()
void forcedStop()
Copyright © 2016 Dexecutor. All rights reserved.