com.metamatrix.query.processor
Interface ProcessorPlan

All Superinterfaces:
java.lang.Cloneable, Describable
All Known Implementing Classes:
BaseProcessorPlan, BatchedUpdatePlan, ProcedurePlan, RelationalPlan, XMLPlan, XQueryPlan

public interface ProcessorPlan
extends java.lang.Cloneable, Describable

This class represents a processor plan. It is generic in that it abstracts the interface to the plan by the processor, meaning that the actual implementation of the plan or the types of processing done by the plan is not important to the processor.

All the implementations of this interface need to implement clone() method. The plan is only clonable in the pre or post-processing stage, not during the processing state (things like program state, result sets, etc). It's only safe to clone in between query processings. In other words, it's only safe to call clone() before the call to open() or after the call to close().


Field Summary
 
Fields inherited from interface com.metamatrix.query.processor.Describable
PROP_BINDINGS, PROP_CHILDREN, PROP_CONDITIONS, PROP_CRITERIA, PROP_DATA_COL, PROP_DEFAULT, PROP_DEFAULT_PROGRAM, PROP_ELSE, PROP_ENCODING, PROP_EXECUTION_PLAN, PROP_EXPRESSION, PROP_FORMATTED, PROP_GROUP, PROP_GROUP_COLS, PROP_IN_MEMORY, PROP_INTO_GROUP, PROP_IS_STAGING, PROP_JOIN_CRITERIA, PROP_JOIN_STRATEGY, PROP_JOIN_TYPE, PROP_MESSAGE, PROP_MODEL_NAME, PROP_NAMESPACE, PROP_NAMESPACE_DECL, PROP_NODE_COST_ESTIMATES, PROP_NODE_STATS_LIST, PROP_NODE_STATS_PROPS, PROP_OPTIONAL, PROP_OUTPUT_COLS, PROP_PROGRAM, PROP_PROGRAMS, PROP_RECURSE_DIR, PROP_REMOVE_DUPS, PROP_RESULT_SET, PROP_ROW_LIMIT, PROP_ROW_OFFSET, PROP_SELECT_COLS, PROP_SORT_COLS, PROP_SQL, PROP_TAG, PROP_THEN, PROP_TYPE, PROP_VARIABLE
 
Method Summary
 java.lang.Object clone()
          Return a safe clone of the ProcessorPlan.
 void close()
          Close the plan after processing.
 java.util.List<java.lang.Exception> getAndClearWarnings()
          Get all warnings found while processing this plan.
 java.util.Collection getChildPlans()
          Finds all nested plans and returns them.
 CommandContext getContext()
          Get the processor context, which can be modified.
 java.util.List getOutputElements()
          Get list of resolved elements describing output columns for this plan.
 void initialize(CommandContext context, ProcessorDataManager dataMgr, BufferManager bufferMgr)
          Initialize the plan with some required pieces of data for making queries.
 TupleBatch nextBatch()
          Get a batch of results or possibly an Exception.
 void open()
          Open the plan for processing.
 void reset()
          Reset a plan so that it can be processed again.
 
Methods inherited from interface com.metamatrix.query.processor.Describable
getDescriptionProperties
 

Method Detail

initialize

void initialize(CommandContext context,
                ProcessorDataManager dataMgr,
                BufferManager bufferMgr)
Initialize the plan with some required pieces of data for making queries. The data manager is used to make queries and the processorID must be passed with the request so the data manager can find the processor again.

Parameters:
context - Process execution context
dataMgr - Data manager reference
bufferMgr - Buffer manager reference

getAndClearWarnings

java.util.List<java.lang.Exception> getAndClearWarnings()
Get all warnings found while processing this plan. These warnings may be detected throughout the plan lifetime, which means new ones may arrive at any time. This method returns all current warnings and clears the current warnings list. The warnings are in order they were detected.

Returns:
Current list of warnings, never null

reset

void reset()
Reset a plan so that it can be processed again.


getOutputElements

java.util.List getOutputElements()
Get list of resolved elements describing output columns for this plan.

Returns:
List of SingleElementSymbol

getContext

CommandContext getContext()
Get the processor context, which can be modified.

Returns:
context object

open

void open()
          throws MetaMatrixComponentException,
                 MetaMatrixProcessingException
Open the plan for processing.

Throws:
MetaMatrixComponentException
MetaMatrixProcessingException

nextBatch

TupleBatch nextBatch()
                     throws BlockedException,
                            MetaMatrixComponentException,
                            MetaMatrixProcessingException
Get a batch of results or possibly an Exception.

Returns:
Batch of results
Throws:
BlockedException - indicating next batch is not available yet
MetaMatrixComponentException - for non-business rule exception
MetaMatrixProcessingException - for business rule exception, related to user input or modeling

close

void close()
           throws MetaMatrixComponentException
Close the plan after processing.

Throws:
MetaMatrixComponentException

clone

java.lang.Object clone()
Return a safe clone of the ProcessorPlan. A ProcessorPlan may only be safely cloned in between processings. That is, it is only safe to clone a plan before it is opened or after it is closed.

Returns:
safe clone of this ProcessorPlan, as long as it is not open for processing

getChildPlans

java.util.Collection getChildPlans()
Finds all nested plans and returns them.

Returns:
List of ProcessorPlan
Since:
4.2


Copyright © 2009. All Rights Reserved.