public class ProcedurePlan extends ProcessorPlan implements ProcessorDataManager
| Constructor and Description |
|---|
ProcedurePlan(Program originalProgram)
Constructor for ProcedurePlan.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
checkNotNull(ElementSymbol param,
Object value,
QueryMetadataInterface metadata) |
ProcessorPlan |
clone()
Return a safe clone of the ProcessorPlan.
|
void |
close()
Close the plan after processing.
|
void |
executePlan(ProcessorPlan command,
String rsName,
Map<ElementSymbol,ElementSymbol> procAssignments,
CreateCursorResultSetInstruction.Mode mode,
boolean usesLocalTemp) |
CommandContext |
getContext()
Get the processor context, which can be modified.
|
List<?> |
getCurrentRow(String rsName) |
VariableContext |
getCurrentVariableContext()
Get the current
VariavleContext on this environment. |
ProcessorDataManager |
getDataManager() |
PlanNode |
getDescriptionProperties() |
EventDistributor |
getEventDistributor() |
Program |
getOriginalProgram() |
List |
getOutputElements()
Get list of resolved elements describing output columns for this plan.
|
List |
getSchema(String rsName)
Get the schema from the tuple source that
represents the columns in a result set
|
TempTableStore |
getTempTableStore() |
void |
incrementProgramCounter() |
void |
initialize(CommandContext context,
ProcessorDataManager dataMgr,
BufferManager bufferMgr)
Initialize the plan with some required pieces of data for making
queries.
|
protected boolean |
isBatchFull() |
boolean |
isValidateAccess() |
boolean |
iterateCursor(String rsName) |
Object |
lookupCodeValue(CommandContext context,
String codeTableName,
String returnElementName,
String keyElementName,
Object keyValue)
Lookup a value from a cached code table.
|
TupleBatch |
nextBatch()
Get a batch of results or possibly an Exception.
|
TupleBatch |
nextBatchDirect() |
void |
open()
Open the plan for processing.
|
Program |
peek() |
void |
pop(boolean success) |
protected TupleBatch |
pullBatch() |
void |
push(Program program) |
TupleSource |
registerRequest(CommandContext context,
Command command,
String modelName,
RegisterRequestParameter parameterObject) |
void |
removeResults(String rsName) |
Boolean |
requiresTransaction(boolean transactionalReads) |
void |
reset()
Reset a plan so that it can be processed again.
|
boolean |
resultSetExists(String rsName) |
void |
setMetadata(QueryMetadataInterface metadata) |
void |
setOutParams(List<ElementSymbol> outParams) |
void |
setOutputElements(List outputElements) |
protected void |
setParameterValue(ElementSymbol param,
VariableContext context,
Object value) |
void |
setParams(LinkedHashMap<ElementSymbol,Expression> params) |
void |
setRunInContext(boolean runInContext)
For procedures without explicit parameters, sets whether the
procedure should run in the parent variable context.
|
void |
setUpdateCount(int updateCount) |
void |
setValidateAccess(boolean b) |
protected void |
terminateBatches() |
String |
toString() |
addWarning, getBuffer, hasBuffer, setContextpublic ProcedurePlan(Program originalProgram)
public Program getOriginalProgram()
public void initialize(CommandContext context, ProcessorDataManager dataMgr, BufferManager bufferMgr)
ProcessorPlaninitialize in class ProcessorPlancontext - Process execution contextdataMgr - Data manager referencebufferMgr - Buffer manager referenceProcessorPlan#initialize(ProcessorDataManager, Object)public void reset()
ProcessorPlanreset in class ProcessorPlanpublic ProcessorDataManager getDataManager()
public void open()
throws TeiidProcessingException,
TeiidComponentException
ProcessorPlanopen in class ProcessorPlanTeiidComponentExceptionTeiidProcessingExceptionpublic static void checkNotNull(ElementSymbol param, Object value, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException, QueryValidatorException
protected void setParameterValue(ElementSymbol param, VariableContext context, Object value)
public TupleBatch nextBatch() throws BlockedException, TeiidComponentException, TeiidProcessingException
ProcessorPlannextBatch in interface BatchCollector.BatchProducernextBatch in class ProcessorPlanBlockedException - indicating next batch is not available yetTeiidComponentException - for non-business rule exceptionTeiidProcessingException - for business rule exception, related
to user input or modelingpublic TupleBatch nextBatchDirect() throws TeiidComponentException, TeiidProcessingException, BlockedException
public void close()
throws TeiidComponentException
ProcessorPlanclose in interface BatchCollector.BatchProducerclose in class ProcessorPlanTeiidComponentExceptionpublic ProcessorPlan clone()
ProcessorPlanopened or after it is closed.clone in class ProcessorPlanprotected void terminateBatches()
protected boolean isBatchFull()
protected TupleBatch pullBatch()
public PlanNode getDescriptionProperties()
getDescriptionProperties in class ProcessorPlanpublic void setMetadata(QueryMetadataInterface metadata)
public void setOutParams(List<ElementSymbol> outParams)
public void setParams(LinkedHashMap<ElementSymbol,Expression> params)
public VariableContext getCurrentVariableContext()
Get the current VariavleContext on this environment.
The VariableContext is updated with variables and their values by
ProgramInstructions that are part of the ProcedurePlan that use
this environment.
VariariableContext.public void executePlan(ProcessorPlan command, String rsName, Map<ElementSymbol,ElementSymbol> procAssignments, CreateCursorResultSetInstruction.Mode mode, boolean usesLocalTemp) throws TeiidComponentException, TeiidProcessingException
command - rsName - procAssignments - mode - usesLocalTemp - - only matters in HOLD modeTeiidComponentExceptionTeiidProcessingExceptionpublic void pop(boolean success)
throws TeiidComponentException
success - TeiidComponentExceptionXATransactionExceptionpublic void push(Program program) throws XATransactionException
XATransactionExceptionpublic void incrementProgramCounter()
throws TeiidComponentException
TeiidComponentExceptionpublic List<?> getCurrentRow(String rsName) throws TeiidComponentException
TeiidComponentExceptionpublic boolean iterateCursor(String rsName) throws TeiidComponentException, TeiidProcessingException
public void removeResults(String rsName)
public List getSchema(String rsName) throws TeiidComponentException
rsName - the ResultSet name (not a temp group)QueryProcessorException - if the list of elements is nullTeiidComponentExceptionpublic boolean resultSetExists(String rsName)
public CommandContext getContext()
ProcessorPlangetContext in class ProcessorPlanpublic List getOutputElements()
ProcessorPlangetOutputElements in interface BatchCollector.BatchProducergetOutputElements in class ProcessorPlanpublic void setOutputElements(List outputElements)
public TempTableStore getTempTableStore()
public Program peek()
public void setUpdateCount(int updateCount)
public Boolean requiresTransaction(boolean transactionalReads)
requiresTransaction in class ProcessorPlanpublic void setRunInContext(boolean runInContext)
runInContext - public TupleSource registerRequest(CommandContext context, Command command, String modelName, RegisterRequestParameter parameterObject) throws TeiidComponentException, TeiidProcessingException
registerRequest in interface ProcessorDataManagerTeiidComponentExceptionTeiidProcessingExceptionpublic Object lookupCodeValue(CommandContext context, String codeTableName, String returnElementName, String keyElementName, Object keyValue) throws BlockedException, TeiidComponentException, TeiidProcessingException
ProcessorDataManagerlookupCodeValue in interface ProcessorDataManagerBlockedExceptionTeiidComponentExceptionTeiidProcessingExceptionpublic EventDistributor getEventDistributor()
getEventDistributor in interface ProcessorDataManagerpublic void setValidateAccess(boolean b)
public boolean isValidateAccess()
Copyright © 2018 JBoss by Red Hat. All rights reserved.