ProcessingContextType
- the processing context object typepublic abstract class QueryProcessor<ProcessingContextType> extends Object implements Processor
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 and Description |
---|
QueryProcessor() |
Modifier and Type | Method and Description |
---|---|
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() |
public QueryResults execute(QueryContext context, QueryCommand command, QueryResults.Statistics statistics, PlanNode plan)
Processor
protected ProcessingContextType createProcessingContext(QueryContext queryContext)
queryContext
- the context in which the query is being executed; never nullprotected 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 nullprotected 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 nullproblems
protected QueryResults.Columns createColumnsFor(PlanNode node, QueryResults.Columns projectedColumns)
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.