Package org.teiid.query.processor
Class QueryProcessor
- java.lang.Object
-
- org.teiid.query.processor.QueryProcessor
-
- All Implemented Interfaces:
BatchCollector.BatchProducer
public class QueryProcessor extends Object implements BatchCollector.BatchProducer
Driver for plan processing.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueryProcessor.ExpiredTimeSliceException
static interface
QueryProcessor.ProcessorFactory
-
Constructor Summary
Constructors Constructor Description QueryProcessor(ProcessorPlan plan, CommandContext context, BufferManager bufferMgr, ProcessorDataManager dataMgr)
Construct a processor with all necessary information to process.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
closeProcessing()
Close processing and clean everything up.BatchCollector
createBatchCollector()
List<Exception>
getAndClearWarnings()
TupleBuffer
getBuffer(int maxRows)
return the final tuple buffer or null if not availableBufferManager
getBufferManager()
CommandContext
getContext()
List
getOutputElements()
Get list of resolved elements describing output columns for this plan.ProcessorDataManager
getProcessorDataManager()
ProcessorPlan
getProcessorPlan()
boolean
hasBuffer()
void
init()
TupleBatch
nextBatch()
Get a batch of results or possibly an Exception.void
requestCanceled()
Asynch shutdown of the QueryProcessor, which may trigger exceptions in the processing threadvoid
setContinuous(PreparedPlan prepPlan, String query)
void
setNonBlocking(boolean nonBlocking)
-
-
-
Constructor Detail
-
QueryProcessor
public QueryProcessor(ProcessorPlan plan, CommandContext context, BufferManager bufferMgr, ProcessorDataManager dataMgr)
Construct a processor with all necessary information to process.- Parameters:
plan
- The plan to processcontext
- The context that this plan is being processed in. Should be cloned from the parent to properly scope the tuplebuffer cachebufferMgr
- The buffer manager that provides access to tuple sourcesdataMgr
- The data manager that provides access to get data
-
-
Method Detail
-
getContext
public CommandContext getContext()
-
getProcessorPlan
public ProcessorPlan getProcessorPlan()
-
nextBatch
public TupleBatch nextBatch() throws BlockedException, TeiidProcessingException, TeiidComponentException
Description copied from interface:BatchCollector.BatchProducer
Get a batch of results or possibly an Exception.- Specified by:
nextBatch
in interfaceBatchCollector.BatchProducer
- Returns:
- Batch of results
- Throws:
BlockedException
- indicating next batch is not available yetTeiidProcessingException
- for business rule exception, related to user input or modelingTeiidComponentException
- for non-business rule exception
-
init
public void init() throws TeiidComponentException, TeiidProcessingException
-
closeProcessing
public void closeProcessing()
Close processing and clean everything up. Should only be called by the same thread that called process.
-
getOutputElements
public List getOutputElements()
Description copied from interface:BatchCollector.BatchProducer
Get list of resolved elements describing output columns for this plan.- Specified by:
getOutputElements
in interfaceBatchCollector.BatchProducer
- Returns:
- List of SingleElementSymbol
-
requestCanceled
public void requestCanceled()
Asynch shutdown of the QueryProcessor, which may trigger exceptions in the processing thread
-
createBatchCollector
public BatchCollector createBatchCollector() throws TeiidComponentException
- Throws:
TeiidComponentException
-
setNonBlocking
public void setNonBlocking(boolean nonBlocking)
-
getBuffer
public TupleBuffer getBuffer(int maxRows) throws BlockedException, TeiidComponentException, TeiidProcessingException
Description copied from interface:BatchCollector.BatchProducer
return the final tuple buffer or null if not available- Specified by:
getBuffer
in interfaceBatchCollector.BatchProducer
- Returns:
- Throws:
BlockedException
TeiidComponentException
TeiidProcessingException
-
hasBuffer
public boolean hasBuffer()
- Specified by:
hasBuffer
in interfaceBatchCollector.BatchProducer
-
getBufferManager
public BufferManager getBufferManager()
-
setContinuous
public void setContinuous(PreparedPlan prepPlan, String query)
-
close
public void close() throws TeiidComponentException
- Specified by:
close
in interfaceBatchCollector.BatchProducer
- Throws:
TeiidComponentException
-
getProcessorDataManager
public ProcessorDataManager getProcessorDataManager()
-
-