|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.jcr.query.process.QueryProcessor<ProcessingContextType>
ProcessingContextType
- the processing context object typepublic abstract class QueryProcessor<ProcessingContextType>
An abstract Processor
implementation that builds a tree of ProcessingComponent
objects to perform the different
parts of the query processing logic. Subclasses are required to only implement one method: the
#createAccessComponent(QueryCommand, QueryContext, PlanNode, Columns, Object)
should create a ProcessorComponent object
that will perform the (low-level access) query described by the plan
given as a parameter.
Constructor Summary | |
---|---|
QueryProcessor()
|
Method Summary | |
---|---|
protected void |
closeProcessingContext(ProcessingContextType processingContext)
A method that can be overridden to close the supplied processing context. |
protected abstract ProcessingComponent |
createAccessComponent(QueryCommand originalQuery,
QueryContext context,
PlanNode accessNode,
QueryResults.Columns resultColumns,
ProcessingContextType processingContext)
Create the ProcessingComponent that processes a single PlanNode.Type.ACCESS branch of a query plan. |
protected QueryResults.Columns |
createColumnsFor(PlanNode node,
QueryResults.Columns projectedColumns)
|
protected ProcessingComponent |
createComponent(QueryCommand originalQuery,
QueryContext context,
PlanNode node,
QueryResults.Columns columns,
ProcessingContextType processingContext)
Method that is called to build up the ProcessingComponent objects that correspond to the optimized query plan. |
protected ProcessingContextType |
createProcessingContext(QueryContext queryContext)
A method that can be overridden by subclasses to create a single context object used for all the access queries for a single query. |
QueryResults |
execute(QueryContext context,
QueryCommand command,
QueryResults.Statistics statistics,
PlanNode plan)
Process the supplied query plan for the given command and return the results. |
protected abstract boolean |
supportsPushDownExistConstraints()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueryProcessor()
Method Detail |
---|
public QueryResults execute(QueryContext context, QueryCommand command, QueryResults.Statistics statistics, PlanNode plan)
Processor
execute
in interface Processor
context
- the context in which the command is being processedcommand
- the command being executedstatistics
- the time metrics up until this executionplan
- the plan to be processed
protected ProcessingContextType createProcessingContext(QueryContext queryContext)
queryContext
- the context in which the query is being executed; never null
protected void closeProcessingContext(ProcessingContextType processingContext)
createProcessingContext(QueryContext)
processingContext
- the processing context in which the query is being executed; null if
createProcessingContext(QueryContext)
returned nullprotected abstract boolean supportsPushDownExistConstraints()
protected abstract ProcessingComponent createAccessComponent(QueryCommand originalQuery, QueryContext context, PlanNode accessNode, QueryResults.Columns resultColumns, ProcessingContextType processingContext)
ProcessingComponent
that processes a single PlanNode.Type.ACCESS
branch of a query plan.
originalQuery
- the original query that is being executed; never nullcontext
- the context in which query is being evaluated; never nullaccessNode
- the node in the query plan that represents the PlanNode.Type.ACCESS
plan; never nullresultColumns
- the columns that are to be returned; never nullprocessingContext
- the processing context in which the query is being executed; null if
createProcessingContext(QueryContext)
returned null
protected ProcessingComponent createComponent(QueryCommand originalQuery, QueryContext context, PlanNode node, QueryResults.Columns columns, ProcessingContextType processingContext)
ProcessingComponent
objects that correspond to the optimized query plan. This
method is called by #execute(QueryContext, QueryCommand, Statistics, PlanNode)
for each of the various
PlanNode
objects in the optimized query plan, and the method is actually recursive (since the optimized query plan
forms a tree). However, whenever this call structure reaches the ACCESS
nodes in the query plan (which
each represents a separate atomic low-level query to the underlying system), the
#createAccessComponent(QueryCommand, QueryContext, PlanNode, Columns, Object)
method is called. Subclasses should
create an appropriate ProcessingComponent implementation that performs this atomic low-level query.
originalQuery
- the original query that is being executed; never nullcontext
- the context in which query is being evaluatednode
- the plan node for which the ProcessingComponent is to be createdcolumns
- the definition of the result columns for this portion of the queryprocessingContext
- the processing context in which the query is being executed; null if
createProcessingContext(QueryContext)
returned null
problems
protected QueryResults.Columns createColumnsFor(PlanNode node, QueryResults.Columns projectedColumns)
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |