| Package | Description |
|---|---|
| org.modeshape.jcr.index.local | |
| org.modeshape.jcr.query |
The Query API provides a mechanism for building and executing queries.
|
| org.modeshape.jcr.query.engine |
This package contains several fully-functional query engine implementations.
|
| org.modeshape.jcr.query.optimize |
This package contains the Optimizer interface, a rule-based optimizer implementation, and library of optimization rules.
|
| org.modeshape.jcr.query.plan |
This package defines the
Planner interface, the CanonicalPlanner implementation, and the
PlanNode class that is used to represent a canonical query plan. |
| org.modeshape.jcr.query.validate |
This package provides the interfaces that define the tables and columns that can be queried.
|
| org.modeshape.jcr.spi.index.provider |
This package contains the Service Provider Interface (SPI) for custom index providers, which are components that encapsulate
how ModeShape updates and uses a set of particular indexes.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
LocalIndexProvider.planUseOfIndex(QueryContext context,
IndexCostCalculator calculator,
String workspaceName,
ManagedIndex index,
IndexDefinition defn) |
| Modifier and Type | Method and Description |
|---|---|
QueryContext |
QueryEngine.createQueryContext(ExecutionContext context,
RepositoryCache repositoryCache,
Set<String> workspaceNames,
Map<String,NodeCache> overriddenNodeCachesByWorkspaceName,
Schemata schemata,
RepositoryIndexes indexDefns,
NodeTypes nodeTypes,
BufferManager bufferManager,
PlanHints hints,
Map<String,Object> variables)
Create a new context for query execution.
|
QueryContext |
QueryContext.with(Map<String,Object> variables)
Obtain a copy of this context, except that the copy uses the supplied variables.
|
QueryContext |
QueryContext.with(PlanHints hints)
Obtain a copy of this context, except that the copy uses the supplied hints.
|
QueryContext |
QueryContext.with(Problems problems)
Obtain a copy of this context, except that the copy uses the supplied problem container.
|
QueryContext |
QueryContext.with(Schemata schemata)
Obtain a copy of this context, except that the copy uses the supplied schemata.
|
| Modifier and Type | Method and Description |
|---|---|
QueryResults |
QueryEngine.execute(QueryContext context,
QueryCommand query)
Execute the supplied query by planning, optimizing, and then processing it.
|
| Constructor and Description |
|---|
QueryContext(QueryContext original)
Create a new context that is a copy of the supplied context.
|
| Modifier and Type | Method and Description |
|---|---|
QueryContext |
ScanningQueryEngine.createQueryContext(ExecutionContext context,
RepositoryCache repositoryCache,
Set<String> workspaceNames,
Map<String,NodeCache> overriddenNodeCachesByWorkspaceName,
Schemata schemata,
RepositoryIndexes indexDefns,
NodeTypes nodeTypes,
BufferManager bufferManager,
PlanHints hints,
Map<String,Object> variables) |
| Modifier and Type | Method and Description |
|---|---|
void |
IndexQueryEngine.ProviderIndexPlanner.applyIndexes(QueryContext context,
IndexCostCalculator calculator) |
abstract void |
IndexPlanners.applyIndexes(QueryContext context,
IndexCostCalculator calculator)
Examine the supplied constraints applied to the given selector in a query, and record in the supplied
IndexCostCalculator any and all indexes in this provider that can be used in this query. |
protected RowExtractors.ExtractFromRow |
ScanningQueryEngine.createExtractFromRow(DynamicOperand operand,
QueryContext context,
QueryResults.Columns columns,
QuerySources sources,
TypeSystem.TypeFactory<?> defaultType,
boolean allowMultiValued,
boolean isLike)
Create a
RowExtractors.ExtractFromRow implementation that performs the supplied DynamicOperand against a current row in
the current batch. |
protected RowExtractors.ExtractFromRow |
ScanningQueryEngine.createExtractFromRow(String selectorName,
String propertyName,
QueryContext context,
QueryResults.Columns columns,
QuerySources sources,
TypeSystem.TypeFactory<?> defaultType,
boolean allowMultiValued)
Create a
RowExtractors.ExtractFromRow implementation that accesses the value(s) in the property identified by the supplied
selector and property names. |
protected RowExtractors.ExtractFromRow |
ScanningQueryEngine.createExtractReferencesFromRow(String selectorName,
QueryContext context,
QueryResults.Columns columns,
QuerySources sources,
TypeSystem.TypeFactory<?> defaultType)
Create a
RowExtractors.ExtractFromRow implementation that accesses the REFERENCE value(s) in the properties of the node
identified by the supplied selector names. |
protected NodeSequence |
ScanningQueryEngine.createNodeSequenceForSource(QueryCommand originalQuery,
QueryContext context,
PlanNode sourceNode,
IndexPlan index,
QueryResults.Columns columns,
QuerySources sources)
Create a node sequence for the given index
|
protected NodeSequence |
IndexQueryEngine.createNodeSequenceForSource(QueryCommand originalQuery,
QueryContext context,
PlanNode sourceNode,
IndexPlan indexPlan,
QueryResults.Columns columns,
QuerySources sources) |
protected NodeSequence |
ScanningQueryEngine.createNodeSequenceForSource(QueryCommand originalQuery,
QueryContext context,
PlanNode sourceNode,
QueryResults.Columns columns,
QuerySources sources)
Create a node sequence for the given source.
|
protected NodeSequence.RowFilter |
ScanningQueryEngine.createRowFilter(Constraint constraint,
QueryContext context,
QueryResults.Columns columns,
QuerySources sources)
Create a
NodeSequence.RowFilter implementation given the supplied constraints. |
protected RowExtractors.ExtractFromRow |
ScanningQueryEngine.createSortingExtractor(List<Ordering> orderings,
Map<SelectorName,SelectorName> sourceNamesByAlias,
QueryContext context,
QueryResults.Columns columns,
QuerySources sources)
Create an
RowExtractors.ExtractFromRow instance that produces for given row a single object that can be used to sort all rows in
the specified order. |
protected RowExtractors.ExtractFromRow |
ScanningQueryEngine.createSortingExtractor(Ordering ordering,
Map<SelectorName,SelectorName> sourceNamesByAlias,
QueryContext context,
QueryResults.Columns columns,
QuerySources sources)
Create an
RowExtractors.ExtractFromRow instance that produces for given row a single object that can be used to sort all rows in
the specified order. |
protected TypeSystem.TypeFactory<?> |
ScanningQueryEngine.determineType(DynamicOperand operand,
QueryContext context,
QueryResults.Columns columns) |
QueryResults |
ScanningQueryEngine.execute(QueryContext queryContext,
QueryCommand query)
Execute the supplied query by planning, optimizing, and then processing it.
|
protected static Object |
ScanningQueryEngine.literalValue(StaticOperand staticOperand,
QueryContext context,
TypeSystem.TypeFactory<?> type)
Get the literal value that is defined in the supplied
StaticOperand. |
protected static Set<?> |
ScanningQueryEngine.literalValues(SetCriteria setCriteria,
QueryContext context,
TypeSystem.TypeFactory<?> type) |
protected static String |
IndexPlanners.stringValue(StaticOperand operand,
QueryContext context) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
AddJoinConditionColumnsToSources.addEquiJoinColumn(QueryContext context,
PlanNode node,
Column joinColumn)
Make sure that the supplied column is included in the
projected columns on the supplied
plan node or its children. |
protected boolean |
AddOrderingColumnsToSources.addIfMissing(QueryContext context,
Column column,
List<Column> columns,
List<String> columnTypes)
Check the supplied list of columns for an existing column that matches the supplied
Column, and if none is found
add the supplied Column to the list and add an appropriate type. |
protected boolean |
AddJoinConditionColumnsToSources.addIfMissing(QueryContext context,
Column column,
List<Column> columns,
List<String> columnTypes)
Check the supplied list of columns for an existing column that matches the supplied
Column, and if none is found
add the supplied Column to the list and add an appropriate type. |
protected boolean |
AddOrderingColumnsToSources.addSortColumn(QueryContext context,
PlanNode node,
Column sortColumn)
Make sure that the supplied column is included in the
projected columns on the supplied
plan node or its children. |
protected int |
RewriteAsRangeCriteria.compareStaticOperands(QueryContext context,
Comparison comparison1,
Comparison comparison2)
Compare the values used in the two comparisons
|
protected PlanNode |
RaiseSelectCriteria.copySelectNode(QueryContext context,
PlanNode selectNode,
SelectorName selectorName,
String propertyName,
SelectorName copySelectorName,
String copyPropertyName) |
protected PlanNode |
CopyCriteria.copySelectNode(QueryContext context,
PlanNode selectNode,
SelectorName selectorName,
String propertyName,
SelectorName copySelectorName,
String copyPropertyName) |
protected void |
CopyCriteria.copySelectNodes(QueryContext context,
PlanNode fromJoined,
PlanNode toJoined) |
PlanNode |
RightOuterToLeftOuterJoins.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
RewritePseudoColumns.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
RewritePathAndNameCriteria.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
RewriteIdentityJoins.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
RewriteAsRangeCriteria.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
ReplaceViews.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
ReorderSortAndRemoveDuplicates.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
RemoveEmptyAccessNodes.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
RaiseVariableName.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
RaiseSelectCriteria.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
PushSelectCriteria.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
PushProjects.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
OrderIndexesByCost.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
OptimizerRule.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack)
Optimize the supplied plan using the supplied context, hints, and yet-to-be-run rules.
|
PlanNode |
JoinOrder.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
CopyCriteria.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
ChooseJoinAlgorithm.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
AddOrderingColumnsToSources.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
AddJoinConditionColumnsToSources.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
AddIndexes.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
PlanNode |
AddAccessNodes.execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack) |
protected Comparison |
RewriteAsRangeCriteria.getComparison(QueryContext context,
Comparison comparison1,
Comparison comparison2,
boolean smallest)
Get the comparison with the smallest (or largest) value.
|
protected Object |
RewriteAsRangeCriteria.getValue(QueryContext context,
StaticOperand operand)
Get the value associated with the static operand of the comparison.
|
PlanNode |
RuleBasedOptimizer.optimize(QueryContext context,
PlanNode plan) |
PlanNode |
Optimizer.optimize(QueryContext context,
PlanNode plan)
Optimize the supplied query plan and produce an executable processor plan.
|
protected Constraint |
RewritePseudoColumns.rewrite(QueryContext context,
Constraint constraint) |
protected DynamicOperand |
RewritePseudoColumns.rewrite(QueryContext context,
DynamicOperand operand) |
protected JoinCondition |
RewritePseudoColumns.rewrite(QueryContext context,
JoinCondition condition) |
protected Constraint |
RewriteAsRangeCriteria.rewrite(QueryContext context,
List<Comparison> comparisons)
Rewrite the supplied comparisons, returning the new constraint and nulling in the supplied list those comparisons that were
rewritten (and leaving those that were not rewritten)
|
protected List<Constraint> |
RewritePseudoColumns.rewrite(QueryContext context,
List<Constraint> constraints) |
protected Constraint |
RewritePathAndNameCriteria.rewriteCriteria(QueryContext context,
Constraint constraint) |
protected void |
RewriteIdentityJoins.rewriteJoinNode(QueryContext context,
PlanNode joinNode,
Map<SelectorName,SelectorName> rewrittenSelectors) |
| Modifier and Type | Method and Description |
|---|---|
static PlanNode |
PlanUtil.addMissingProjectColumns(QueryContext context,
PlanNode node,
List<Column> allProjectedColumns) |
protected PlanNode |
CanonicalPlanner.attachCriteria(QueryContext context,
PlanNode plan,
Constraint constraint,
List<? extends Column> columns,
Map<String,Subquery> subqueriesByVariableName)
Attach all criteria above the join nodes.
|
protected PlanNode |
CanonicalPlanner.attachDuplicateRemoval(QueryContext context,
PlanNode plan)
Attach DUP_REMOVE node at top of tree.
|
protected PlanNode |
CanonicalPlanner.attachLimits(QueryContext context,
PlanNode plan,
Limit limit)
Attach a LIMIT node at the top of the plan tree.
|
protected PlanNode |
CanonicalPlanner.attachProject(QueryContext context,
PlanNode plan,
List<? extends Column> columns,
Map<SelectorName,Schemata.Table> selectors)
Attach a PROJECT node at the top of the plan tree.
|
protected PlanNode |
CanonicalPlanner.attachSorting(QueryContext context,
PlanNode plan,
List<? extends Ordering> orderings)
Attach SORT node at top of tree.
|
protected PlanNode |
CanonicalPlanner.attachSubqueries(QueryContext context,
PlanNode plan,
Map<String,Subquery> subqueriesByVariableName)
Attach plan nodes for each subquery, resulting with the first subquery at the top of the plan tree.
|
protected PlanNode |
CanonicalPlanner.createCanonicalPlan(QueryContext context,
Query query)
Create a canonical query plan for the given query.
|
protected PlanNode |
CanonicalPlanner.createCanonicalPlan(QueryContext context,
SetQuery query)
Create a canonical query plan for the given set query.
|
PlanNode |
Planner.createPlan(QueryContext context,
QueryCommand query)
Create a canonical query plan for the given command.
|
PlanNode |
CanonicalPlanner.createPlan(QueryContext context,
QueryCommand query) |
protected PlanNode |
CanonicalPlanner.createPlanNode(QueryContext context,
Source source,
Map<SelectorName,Schemata.Table> usedSelectors)
Create a JOIN or SOURCE node that contain the source information.
|
static List<Column> |
PlanUtil.findRequiredColumns(QueryContext context,
PlanNode planNode)
Collected the minimum set of columns from the supplied table that are required by or used within the plan at the supplied
node or above.
|
static List<String> |
PlanUtil.findRequiredColumnTypes(QueryContext context,
List<Column> columns,
PlanNode node) |
static void |
PlanUtil.removeDuplicateSelectNodesUnderEachAccessNode(QueryContext context,
PlanNode node) |
static Constraint |
PlanUtil.replaceAliasesWithProperties(QueryContext context,
Constraint constraint,
Map<String,String> propertyByAlias) |
static DynamicOperand |
PlanUtil.replaceAliasesWithProperties(QueryContext context,
DynamicOperand operand,
Map<String,String> propertyByAlias) |
protected static PropertyValue |
PlanUtil.replaceAliasesWithProperties(QueryContext context,
PropertyValue value,
Map<String,String> propertyByAlias) |
static Constraint |
PlanUtil.replaceReferences(QueryContext context,
Constraint constraint,
PlanUtil.ColumnMapping mapping,
PlanNode node) |
static Constraint |
PlanUtil.replaceReferencesToRemovedSource(QueryContext context,
Constraint constraint,
Map<SelectorName,SelectorName> rewrittenSelectors) |
static DynamicOperand |
PlanUtil.replaceReferencesToRemovedSource(QueryContext context,
DynamicOperand operand,
Map<SelectorName,SelectorName> rewrittenSelectors) |
static JoinCondition |
PlanUtil.replaceReferencesToRemovedSource(QueryContext context,
JoinCondition joinCondition,
Map<SelectorName,SelectorName> rewrittenSelectors) |
static void |
PlanUtil.replaceReferencesToRemovedSource(QueryContext context,
PlanNode planNode,
Map<SelectorName,SelectorName> rewrittenSelectors) |
static Constraint |
PlanUtil.replaceSubqueriesWithBindVariables(QueryContext context,
Constraint constraint,
Map<String,Subquery> subqueriesByVariableName) |
static StaticOperand |
PlanUtil.replaceSubqueriesWithBindVariables(QueryContext context,
StaticOperand staticOperand,
Map<String,Subquery> subqueriesByVariableName) |
static DynamicOperand |
PlanUtil.replaceViewReferences(QueryContext context,
DynamicOperand operand,
PlanUtil.ColumnMapping mapping,
PlanNode node) |
static JoinCondition |
PlanUtil.replaceViewReferences(QueryContext context,
JoinCondition joinCondition,
PlanUtil.ColumnMapping mapping,
PlanNode node) |
static void |
PlanUtil.replaceViewReferences(QueryContext context,
PlanNode topOfViewInPlan,
PlanUtil.ColumnMapping mappings) |
protected static void |
PlanUtil.replaceViewReferences(QueryContext context,
PlanNode node,
PlanUtil.ColumnMapping mappings,
SelectorName viewName,
List<PlanNode> potentiallyRemovableSources) |
protected void |
CanonicalPlanner.validate(QueryContext context,
QueryCommand query,
Map<SelectorName,Schemata.Table> usedSelectors)
Validate the supplied query.
|
| Constructor and Description |
|---|
Validator(QueryContext context,
Map<SelectorName,Schemata.Table> selectorsByName) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
IndexPlanner.applyIndexes(QueryContext context,
IndexCostCalculator calculator)
Examine the supplied constraints applied to the given selector in a query, and record in the supplied
IndexCostCalculator any and all indexes in this provider that can be used in this query. |
protected abstract void |
IndexProvider.planUseOfIndex(QueryContext context,
IndexCostCalculator calculator,
String workspaceName,
ManagedIndex index,
IndexDefinition defn)
The method that is called by the IndexProvider's
default IndexPlanner for each
managed index in the given workspace. |
| Constructor and Description |
|---|
IndexUsage(QueryContext context,
IndexCostCalculator calculator,
IndexDefinition defn) |
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.