Package org.teiid.query.processor.proc
Class Program
- java.lang.Object
-
- org.teiid.query.processor.proc.Program
-
- All Implemented Interfaces:
Cloneable
,Statement.Labeled
public class Program extends Object implements Cloneable, Statement.Labeled
A program is a sequence ofProgramInstruction
. Certain ProgramInstructions, such asIfInstruction
andWhileInstruction
may have pointers to sub programs.
-
-
Constructor Summary
Constructors Constructor Description Program(boolean atomic)
Constructor for Program.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInstruction(ProgramInstruction instruction)
void
addInstructions(Program instructions)
Program
clone()
Produces a deep clone.void
decrementProgramCounter()
Decrements the program counter, so that the next call togetCurrentInstruction()
will return the previous instruction.ProgramInstruction
getCurrentInstruction()
Returns the next instruction to be executed, or null if there are none or no more instructions.PlanNode
getDescriptionProperties()
String
getExceptionGroup()
Program
getExceptionProgram()
ProgramInstruction
getInstructionAt(int instructionIndex)
Returns the instruction to be executed at the indicated index, or null if there is no instruction at that index.String
getLabel()
List<ProgramInstruction>
getProcessorInstructions()
TempTableStore
getTempTableStore()
void
incrementProgramCounter()
Increments the program counter, so that the next call togetCurrentInstruction()
will return the following instruction.Boolean
instructionsRequireTransaction(boolean transactionalReads)
boolean
isAtomic()
boolean
isTrappingExceptions()
Boolean
requiresTransaction(boolean transactionalReads)
void
reset(String sessionId)
Resets this program, so it can be run through again.void
setExceptionGroup(String exceptionGroup)
void
setExceptionProgram(Program exceptionBlock)
void
setLabel(String label)
void
setStartedTxn(boolean startedTxn)
void
setTrappingExceptions(boolean trappingExceptions)
boolean
startedTxn()
String
toString()
-
-
-
Method Detail
-
setStartedTxn
public void setStartedTxn(boolean startedTxn)
-
startedTxn
public boolean startedTxn()
-
getLabel
public String getLabel()
- Specified by:
getLabel
in interfaceStatement.Labeled
-
setLabel
public void setLabel(String label)
- Specified by:
setLabel
in interfaceStatement.Labeled
-
isAtomic
public boolean isAtomic()
-
getTempTableStore
public TempTableStore getTempTableStore()
-
getCurrentInstruction
public ProgramInstruction getCurrentInstruction()
Returns the next instruction to be executed, or null if there are none or no more instructions.- Returns:
- ProgramInstruction to be executed next, or null if there are no more to execute (or if this Program is empty)
-
incrementProgramCounter
public void incrementProgramCounter()
Increments the program counter, so that the next call togetCurrentInstruction()
will return the following instruction. This method is intended to be used by a ProcessingInstruction itself, to control the flow of execution.
-
decrementProgramCounter
public void decrementProgramCounter()
Decrements the program counter, so that the next call togetCurrentInstruction()
will return the previous instruction. This method is intended to be used by a ProcessingInstruction itself, to control the flow of execution.
-
reset
public void reset(String sessionId)
Resets this program, so it can be run through again.
-
getInstructionAt
public ProgramInstruction getInstructionAt(int instructionIndex)
Returns the instruction to be executed at the indicated index, or null if there is no instruction at that index.- Returns:
- instruction to be executed at the indicated index, or null if there is no instruction at that index.
-
addInstruction
public void addInstruction(ProgramInstruction instruction)
-
addInstructions
public void addInstructions(Program instructions)
-
getDescriptionProperties
public PlanNode getDescriptionProperties()
-
getProcessorInstructions
public List<ProgramInstruction> getProcessorInstructions()
-
setExceptionGroup
public void setExceptionGroup(String exceptionGroup)
-
setExceptionProgram
public void setExceptionProgram(Program exceptionBlock)
-
getExceptionGroup
public String getExceptionGroup()
-
getExceptionProgram
public Program getExceptionProgram()
-
isTrappingExceptions
public boolean isTrappingExceptions()
-
setTrappingExceptions
public void setTrappingExceptions(boolean trappingExceptions)
-
requiresTransaction
public Boolean requiresTransaction(boolean transactionalReads)
-
instructionsRequireTransaction
public Boolean instructionsRequireTransaction(boolean transactionalReads)
-
-