Package org.apache.tinkerpop.gremlin.gql
Class ExtensionStep
java.lang.Object
org.apache.tinkerpop.gremlin.gql.ExtensionStep
A single join step in a compiled
GqlMatchPlan. An ExtensionStep describes
how to extend a partial match by traversing one edge from an already-bound vertex
(the anchor) to a new candidate vertex.
The planner emits one ExtensionStep per QueryEdge in the
QueryGraph, ordered so that the anchor variable is always bound before the
step is executed.
Fields:
anchorVariable— the variable name of the already-bound vertex from which traversal begins; nevernulledgeLabel— optional label constraint on the edge;nullmeans any label is accepteddirection— traversal direction relative to the anchor vertexedgeVariable— optional variable name to which the matching edge is boundtargetLabel— optional label constraint on the target vertextargetVariable— optional variable name to which the target vertex is boundtargetPredicates— property equality predicates on the target vertex, derived from the inline filter map on the correspondingQueryVertexestimatedCost— static selectivity estimate set by the planner; lower values indicate a more selective step that should be tried first when multiple steps are simultaneously eligible. Computed asmin(edgeLabelCount, indexedPropertyCount).
At runtime, the executor maintains adaptive counters (recordAttempt() /
recordHit()) so that selectivityRatio() reflects observed throughput.
The executor uses this ratio — with estimatedCost as a tiebreaker — to choose
among simultaneously eligible steps.
-
Constructor Summary
ConstructorsConstructorDescriptionExtensionStep(String anchorVariable, String edgeLabel, Direction direction, String edgeVariable, String targetLabel, String targetVariable) ExtensionStep(String anchorVariable, String edgeLabel, Direction direction, String edgeVariable, String targetLabel, String targetVariable, List<PropertyPredicate> targetPredicates) ExtensionStep(String anchorVariable, String edgeLabel, Direction direction, String edgeVariable, String targetLabel, String targetVariable, List<PropertyPredicate> targetPredicates, long estimatedCost) ExtensionStep(String anchorVariable, String edgeLabel, Direction direction, String edgeVariable, List<PropertyPredicate> edgePredicates, String targetLabel, String targetVariable, List<PropertyPredicate> targetPredicates, long estimatedCost) -
Method Summary
Modifier and TypeMethodDescriptionThe variable name of the already-bound vertex used as the starting point for this step.The traversal direction from the anchor vertex.The edge label constraint, ornullfor any label.Property equality predicates that the traversed edge must satisfy.The variable name to which the matching edge is bound, ornull.longStatic cost estimate set by the planner.The label constraint on the target vertex, ornullfor any label.Property equality predicates that the target vertex must satisfy, derived from the inline filter map on the targetQueryVertex.The variable name to which the matching target vertex is bound, ornull.toString()
-
Constructor Details
-
ExtensionStep
public ExtensionStep(String anchorVariable, String edgeLabel, Direction direction, String edgeVariable, List<PropertyPredicate> edgePredicates, String targetLabel, String targetVariable, List<PropertyPredicate> targetPredicates, long estimatedCost) -
ExtensionStep
-
ExtensionStep
-
ExtensionStep
-
-
Method Details
-
getAnchorVariable
The variable name of the already-bound vertex used as the starting point for this step. -
getEdgeLabel
The edge label constraint, ornullfor any label. -
getDirection
The traversal direction from the anchor vertex. -
getEdgeVariable
The variable name to which the matching edge is bound, ornull. -
getEdgePredicates
Property equality predicates that the traversed edge must satisfy. Empty if no filter was specified on the edge pattern element. -
getTargetLabel
The label constraint on the target vertex, ornullfor any label. -
getTargetVariable
The variable name to which the matching target vertex is bound, ornull. -
getTargetPredicates
Property equality predicates that the target vertex must satisfy, derived from the inline filter map on the targetQueryVertex. Empty if no filter was specified. -
getEstimatedCost
public long getEstimatedCost()Static cost estimate set by the planner. Lower values indicate a more selective step. Computed asmin(edgeLabelCount, indexedPropertyCount)at plan compile time. -
toString
-