Class CompilerHelper
java.lang.Object
tools.refinery.interpreter.rete.construction.plancompiler.CompilerHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Calculated index mappings for a join, based on the common variables of the two parent subplans.static final class
-
Method Summary
Modifier and TypeMethodDescriptionstatic PlanningTrace
checkAndTrimEqualVariables
(SubPlan plan, PlanningTrace coreTrace) Makes sure that all variables in the tuple are different so that it can be used asCompiledSubPlan
.static CompilerHelper.PosetTriplet
computePosetInfo
(Iterable<Set<IInputKey>> keys, IQueryMetaContext context) static CompilerHelper.PosetTriplet
computePosetInfo
(List<PVariable> variables, PBody body, IQueryMetaContext context) static CompilerHelper.PosetTriplet
computePosetInfo
(List<PParameter> parameters, IQueryMetaContext context) convertVariablesTuple
(EnumerablePConstraint constraint) Extracts the variable list representation of the variables tuple.convertVariablesTuple
(Tuple variablesTuple) Extracts the variable list representation of the variables tuple.static RecipeTraceInfo
makeIndexerTrace
(SubPlan planToCompile, PlanningTrace parentTrace, TupleMask mask) Returns a compiled indexer trace according to a maskstatic Mask
makeProjectionMask
(PlanningTrace compiledParent, Iterable<PVariable> projectedVariables) static CompiledQuery
makeQueryTrace
(PQuery query, Map<PBody, RecipeTraceInfo> bodyFinalTraces, Collection<ReteNodeRecipe> bodyFinalRecipes, QueryEvaluationHint hint, IQueryMetaContext context, boolean deleteAndRederiveEvaluation, TimelyConfiguration timelyEvaluation) Creates a recipe for a production node and the corresponding trace.protected static TrimmerRecipe
makeTrimmerRecipe
(PlanningTrace compiledParent, List<PVariable> projectedVariables) Creates a trimmer that keeps selected variables only.static Mask
toRecipeMask
(TupleMask mask)
-
Method Details
-
checkAndTrimEqualVariables
Makes sure that all variables in the tuple are different so that it can be used asCompiledSubPlan
. If a variable occurs multiple times, equality checks are applied and then the results are trimmed so that duplicates are hidden. If no manipulation is necessary, the original trace is returned.to be used whenever a constraint introduces new variables.
-
convertVariablesTuple
Extracts the variable list representation of the variables tuple. -
convertVariablesTuple
Extracts the variable list representation of the variables tuple. -
makeIndexerTrace
public static RecipeTraceInfo makeIndexerTrace(SubPlan planToCompile, PlanningTrace parentTrace, TupleMask mask) Returns a compiled indexer trace according to a mask -
makeTrimmerRecipe
protected static TrimmerRecipe makeTrimmerRecipe(PlanningTrace compiledParent, List<PVariable> projectedVariables) Creates a trimmer that keeps selected variables only. -
makeProjectionMask
public static Mask makeProjectionMask(PlanningTrace compiledParent, Iterable<PVariable> projectedVariables) -
computePosetInfo
public static CompilerHelper.PosetTriplet computePosetInfo(List<PVariable> variables, PBody body, IQueryMetaContext context) - Since:
- 1.6
-
computePosetInfo
public static CompilerHelper.PosetTriplet computePosetInfo(List<PParameter> parameters, IQueryMetaContext context) - Since:
- 1.6
-
computePosetInfo
public static CompilerHelper.PosetTriplet computePosetInfo(Iterable<Set<IInputKey>> keys, IQueryMetaContext context) - Since:
- 1.6
-
makeQueryTrace
public static CompiledQuery makeQueryTrace(PQuery query, Map<PBody, RecipeTraceInfo> bodyFinalTraces, Collection<ReteNodeRecipe> bodyFinalRecipes, QueryEvaluationHint hint, IQueryMetaContext context, boolean deleteAndRederiveEvaluation, TimelyConfiguration timelyEvaluation) Creates a recipe for a production node and the corresponding trace.PRE: in case this is a recursion cutoff point (see
RecursionCutoffPoint
) and bodyFinalTraces will be filled later, the object yielded now by bodyFinalTraces.values() must return up-to-date results later- Since:
- 2.4
-
toRecipeMask
- Since:
- 1.4
-