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 specificFlowExecution
. Exists because we do not want to ourselves to only using the standard implementation inStandardGraphLookupView
. 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 throwIllegalArgumentException
s if tied to a singleFlowExecution
orFlowExecutionOwner
or use the ID of the execution as a key to delegate to different cache objects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
GraphLookupView.EnclosingBlocksIterable
Provides a trivial implementation to facilitate implementingiterateEnclosingBlocks(FlowNode)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<BlockStartNode>
findAllEnclosingBlockStarts(FlowNode node)
Return all enclosing block start nodes, as withfindEnclosingBlockStart(FlowNode)
.BlockStartNode
findEnclosingBlockStart(FlowNode node)
Find the immediately enclosingBlockStartNode
around aFlowNode
BlockEndNode
getEndNode(BlockStartNode startNode)
Find the end node corresponding to a start node, and can be used to tell if the block is completed.boolean
isActive(FlowNode node)
Tests if the node is a currently running head, or the start of a block that has not completed executingIterable<BlockStartNode>
iterateEnclosingBlocks(FlowNode node)
Provide anIterable
over all enclosing blocks, which can be used similarly tofindAllEnclosingBlockStarts(FlowNode)
but does lazy fetches rather than materializing a full result.
-
-
-
Method Detail
-
isActive
boolean isActive(@NonNull FlowNode node)
Tests if the node is a currently running head, or the start of a block that has not completed executing
-
getEndNode
@CheckForNull BlockEndNode getEndNode(@NonNull BlockStartNode startNode)
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
@CheckForNull BlockStartNode findEnclosingBlockStart(@NonNull FlowNode node)
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
Iterable<BlockStartNode> iterateEnclosingBlocks(@NonNull FlowNode node)
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
@NonNull List<BlockStartNode> findAllEnclosingBlockStarts(@NonNull FlowNode node)
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
-
-