Interface GraphLookupView
- All Known Implementing Classes:
FlowExecution
,StandardGraphLookupView
public interface GraphLookupView
Interface that can be exposed by objects providing means to easily look up information about the structure of a pipeline run
Usually this is scoped to a specific
FlowExecution
.
Exists because we do not want to ourselves to only using the standard implementation in StandardGraphLookupView
.
Implementation note:
Normally this should only be used internally to power APIs, but if exposed publicly remember that FlowNode
s
from different executions may be given as inputs. There needs to be a way to handle that.
Either throw IllegalArgumentException
s if tied to a single FlowExecution
or FlowExecutionOwner
or use the ID of the execution as a key to delegate to different cache objects.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Provides a trivial implementation to facilitate implementingiterateEnclosingBlocks(FlowNode)
-
Method Summary
Modifier and TypeMethodDescriptionReturn all enclosing block start nodes, as withfindEnclosingBlockStart(FlowNode)
.Find the immediately enclosingBlockStartNode
around aFlowNode
getEndNode
(BlockStartNode startNode) Find the end node corresponding to a start node, and can be used to tell if the block is completed.boolean
Tests if the node is a currently running head, or the start of a block that has not completed executingProvide anIterable
over all enclosing blocks, which can be used similarly tofindAllEnclosingBlockStarts(FlowNode)
but does lazy fetches rather than materializing a full result.
-
Method Details
-
isActive
Tests if the node is a currently running head, or the start of a block that has not completed executing -
getEndNode
Find the end node corresponding to a start node, and can be used to tell if the block is completed.- Returns:
BlockEndNode
matching the given start node, or null if block hasn't completed
-
findEnclosingBlockStart
Find the immediately enclosingBlockStartNode
around aFlowNode
- Parameters:
node
- Node to find block enclosing it - note that it this is a BlockStartNode, you will return the start of the block enclosing this one.- Returns:
- Null if node is a
FlowStartNode
orFlowEndNode
-
iterateEnclosingBlocks
Provide anIterable
over all enclosing blocks, which can be used similarly tofindAllEnclosingBlockStarts(FlowNode)
but does lazy fetches rather than materializing a full result. Handy for for-each loops.Usage note:Prefer this to
findAllEnclosingBlockStarts(FlowNode)
in most cases since it can evaluate lazily, unless you know you need all enclosing blocks.- Parameters:
node
- Node to find enclosing blocks for- Returns:
- Iterable over enclosing blocks, from the nearest-enclosing outward ("inside-out" order)
-
findAllEnclosingBlockStarts
Return all enclosing block start nodes, as withfindEnclosingBlockStart(FlowNode)
.Usage note:Prefer using
iterateEnclosingBlocks(FlowNode)
unless you know you need ALL blocks, since that can lazy-load.- Parameters:
node
- Node to find enclosing blocks for- Returns:
- All enclosing block starts from the nearest-enclosing outward ("inside-out" order), or EMPTY_LIST if this is a start or end node
-