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, setContext
public ProcedurePlan(Program originalProgram)
public Program getOriginalProgram()
public void initialize(CommandContext context, ProcessorDataManager dataMgr, BufferManager bufferMgr)
ProcessorPlan
initialize
in class ProcessorPlan
context
- Process execution contextdataMgr
- Data manager referencebufferMgr
- Buffer manager referenceProcessorPlan#initialize(ProcessorDataManager, Object)
public void reset()
ProcessorPlan
reset
in class ProcessorPlan
public ProcessorDataManager getDataManager()
public void open() throws TeiidProcessingException, TeiidComponentException
ProcessorPlan
open
in class ProcessorPlan
TeiidComponentException
TeiidProcessingException
public 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
ProcessorPlan
nextBatch
in interface BatchCollector.BatchProducer
nextBatch
in class ProcessorPlan
BlockedException
- 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
ProcessorPlan
close
in interface BatchCollector.BatchProducer
close
in class ProcessorPlan
TeiidComponentException
public ProcessorPlan clone()
ProcessorPlan
opened
or after it is closed
.clone
in class ProcessorPlan
protected void terminateBatches()
protected boolean isBatchFull()
protected TupleBatch pullBatch()
public PlanNode getDescriptionProperties()
getDescriptionProperties
in class ProcessorPlan
public 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
ProgramInstruction
s 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 modeTeiidComponentException
TeiidProcessingException
public void pop(boolean success) throws TeiidComponentException
success
- TeiidComponentException
XATransactionException
public void push(Program program) throws XATransactionException
XATransactionException
public void incrementProgramCounter() throws TeiidComponentException
TeiidComponentException
public List<?> getCurrentRow(String rsName) throws TeiidComponentException
TeiidComponentException
public 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 nullTeiidComponentException
public boolean resultSetExists(String rsName)
public CommandContext getContext()
ProcessorPlan
getContext
in class ProcessorPlan
public List getOutputElements()
ProcessorPlan
getOutputElements
in interface BatchCollector.BatchProducer
getOutputElements
in class ProcessorPlan
public void setOutputElements(List outputElements)
public TempTableStore getTempTableStore()
public Program peek()
public void setUpdateCount(int updateCount)
public Boolean requiresTransaction(boolean transactionalReads)
requiresTransaction
in class ProcessorPlan
public void setRunInContext(boolean runInContext)
runInContext
- public TupleSource registerRequest(CommandContext context, Command command, String modelName, RegisterRequestParameter parameterObject) throws TeiidComponentException, TeiidProcessingException
registerRequest
in interface ProcessorDataManager
TeiidComponentException
TeiidProcessingException
public Object lookupCodeValue(CommandContext context, String codeTableName, String returnElementName, String keyElementName, Object keyValue) throws BlockedException, TeiidComponentException, TeiidProcessingException
ProcessorDataManager
lookupCodeValue
in interface ProcessorDataManager
BlockedException
TeiidComponentException
TeiidProcessingException
public EventDistributor getEventDistributor()
getEventDistributor
in interface ProcessorDataManager
public void setValidateAccess(boolean b)
public boolean isValidateAccess()
Copyright © 2018 JBoss by Red Hat. All rights reserved.