Class ExpressionCountProperty
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.properties.ExpressionCountProperty
-
- All Implemented Interfaces:
PlannerProperty<Map<Class<? extends RelationalExpression>,Integer>>
public class ExpressionCountProperty extends Object implements PlannerProperty<Map<Class<? extends RelationalExpression>,Integer>>
A property that determines the sum, over all elements of aPlannerExpression
tree, of the number of occurrences of specific types ofRelationalExpression
.This property provides some heuristic sense of how much work is being done by a plan.
-
-
Constructor Summary
Constructors Constructor Description ExpressionCountProperty(Set<Class<? extends RelationalExpression>> expressionClasses)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
count(Class<? extends RelationalExpression> expressionClass, RelationalExpression expression)
static int
count(Set<Class<? extends RelationalExpression>> expressionClasses, RelationalExpression expression)
static Map<Class<? extends RelationalExpression>,Integer>
evaluate(Set<Class<? extends RelationalExpression>> expressionClasses, RelationalExpression expression)
Map<Class<? extends RelationalExpression>,Integer>
evaluateAtExpression(RelationalExpression expression, List<Map<Class<? extends RelationalExpression>,Integer>> childResults)
Evaluate the property at the given expression, using the results of evaluating the property at its children.Map<Class<? extends RelationalExpression>,Integer>
evaluateAtRef(ExpressionRef<? extends RelationalExpression> ref, List<Map<Class<? extends RelationalExpression>,Integer>> memberResults)
Evaluate the property at the given reference, using the results of evaluating the property at its members.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.apple.foundationdb.record.query.plan.temp.PlannerProperty
evaluateAtQuantifier, shouldVisit, shouldVisit, shouldVisit
-
-
-
-
Constructor Detail
-
ExpressionCountProperty
public ExpressionCountProperty(Set<Class<? extends RelationalExpression>> expressionClasses)
-
-
Method Detail
-
evaluateAtExpression
@Nonnull public Map<Class<? extends RelationalExpression>,Integer> evaluateAtExpression(@Nonnull RelationalExpression expression, @Nonnull List<Map<Class<? extends RelationalExpression>,Integer>> childResults)
Description copied from interface:PlannerProperty
Evaluate the property at the given expression, using the results of evaluating the property at its children. Called on nodes in the graph in visit post-order of the depth-first traversal of the graph. That is, as each expression is visited (after all of its children have been visited, if applicable),evaluateAtExpression()
is called on that expression.- Specified by:
evaluateAtExpression
in interfacePlannerProperty<Map<Class<? extends RelationalExpression>,Integer>>
- Parameters:
expression
- the cursor to visitchildResults
- the results of the property evaluated at the children ofexpression
- Returns:
- the value of property at the given expression
-
evaluateAtRef
@Nonnull public Map<Class<? extends RelationalExpression>,Integer> evaluateAtRef(@Nonnull ExpressionRef<? extends RelationalExpression> ref, @Nonnull List<Map<Class<? extends RelationalExpression>,Integer>> memberResults)
Description copied from interface:PlannerProperty
Evaluate the property at the given reference, using the results of evaluating the property at its members. Called on nodes in the graph in visit post-order of the depth-first traversal of the graph. That is, as each reference is visited (after all of its members have been visited, if applicable),evaluateAtRef()
is called on that reference.- Specified by:
evaluateAtRef
in interfacePlannerProperty<Map<Class<? extends RelationalExpression>,Integer>>
- Parameters:
ref
- the expression reference to visitmemberResults
- the results of the property evaluated at the members ofref
- Returns:
- the value of property at the given reference
-
count
public static int count(@Nonnull Class<? extends RelationalExpression> expressionClass, @Nonnull RelationalExpression expression)
-
count
public static int count(@Nonnull Set<Class<? extends RelationalExpression>> expressionClasses, @Nonnull RelationalExpression expression)
-
evaluate
@Nonnull public static Map<Class<? extends RelationalExpression>,Integer> evaluate(@Nonnull Set<Class<? extends RelationalExpression>> expressionClasses, @Nonnull RelationalExpression expression)
-
-