Author: shawkins
Date: 2009-04-15 16:29:00 -0400 (Wed, 15 Apr 2009)
New Revision: 781
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/AssignmentInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ErrorInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecSqlInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/IfInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ProcedurePlan.java
Log:
TEIID-127 changing from planner to dqp context
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/AssignmentInstruction.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/AssignmentInstruction.java 2009-04-15
20:21:58 UTC (rev 780)
+++
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/AssignmentInstruction.java 2009-04-15
20:29:00 UTC (rev 781)
@@ -27,8 +27,8 @@
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.dqp.util.LogConstants;
import com.metamatrix.query.sql.util.VariableContext;
-import com.metamatrix.query.util.LogConstants;
/**
* <p> This instruction updates the current variable context with a value for the
Variable
@@ -60,7 +60,7 @@
protected void processValue(Object value, VariableContext varContext) throws
MetaMatrixComponentException,
MetaMatrixProcessingException {
varContext.setValue(getVariable(), value);
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER,
+ LogManager.logTrace(LogConstants.CTX_DQP,
new Object[] {this.toString() + " The variable "
//$NON-NLS-1$
+ getVariable() + " in the variablecontext
is updated with the value :", value}); //$NON-NLS-1$
}
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ErrorInstruction.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ErrorInstruction.java 2009-04-15
20:21:58 UTC (rev 780)
+++
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ErrorInstruction.java 2009-04-15
20:29:00 UTC (rev 781)
@@ -28,8 +28,8 @@
import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.api.exception.query.ProcedureErrorInstructionException;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.dqp.util.LogConstants;
import com.metamatrix.query.sql.util.VariableContext;
-import com.metamatrix.query.util.LogConstants;
/**
* <p> This instruction updates the current variable context with the Variable
defined using
@@ -67,7 +67,7 @@
*/
protected void processValue(Object value, VariableContext varContext) throws
MetaMatrixComponentException,
MetaMatrixProcessingException {
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER,
+ LogManager.logTrace(LogConstants.CTX_DQP,
new Object[] {"Processing RaiseErrorInstruction with the
value :", value}); //$NON-NLS-1$
throw new ProcedureErrorInstructionException(ERROR_PREFIX + (value != null ?
value.toString() : "")); //$NON-NLS-1$
}
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java 2009-04-15
20:21:58 UTC (rev 780)
+++
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java 2009-04-15
20:29:00 UTC (rev 781)
@@ -38,6 +38,7 @@
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.core.id.IDGenerator;
+import com.metamatrix.dqp.util.LogConstants;
import com.metamatrix.query.analysis.AnalysisRecord;
import com.metamatrix.query.execution.QueryExecPlugin;
import com.metamatrix.query.metadata.QueryMetadataInterface;
@@ -75,9 +76,7 @@
import com.metamatrix.query.sql.symbol.SingleElementSymbol;
import com.metamatrix.query.sql.util.VariableContext;
import com.metamatrix.query.sql.visitor.GroupCollectorVisitor;
-import com.metamatrix.query.sql.visitor.ReferenceCollectorVisitor;
import com.metamatrix.query.util.CommandContext;
-import com.metamatrix.query.util.LogConstants;
/**
* <p>
@@ -152,7 +151,7 @@
LogManager
.logTrace(
- LogConstants.CTX_QUERY_PLANNER,
+ LogConstants.CTX_DQP,
"Processing ExecDynamicSqlInstruction as part of processing the update
procedure"); //$NON-NLS-1$
ProcedureEnvironment procEnv = (ProcedureEnvironment) env;
@@ -167,7 +166,7 @@
.getString("ExecDynamicSqlInstruction.0")); //$NON-NLS-1$
}
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER,
+ LogManager.logTrace(LogConstants.CTX_DQP,
new Object[] { "Executing dynamic sql ", value }); //$NON-NLS-1$
Command command = QueryParser.getQueryParser().parseCommand(value.toString());
@@ -253,7 +252,7 @@
for (SetClause setClause : dynamicCommand.getUsing().getClauses()) {
Object assignment = procEnv.evaluateExpression(setClause.getValue());
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER,
+ LogManager.logTrace(LogConstants.CTX_DQP,
new Object[] { this, " The using variable ", //$NON-NLS-1$
setClause.getSymbol(), " has value :", assignment }); //$NON-NLS-1$
localContext.setValue(setClause.getSymbol(),
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecSqlInstruction.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecSqlInstruction.java 2009-04-15
20:21:58 UTC (rev 780)
+++
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecSqlInstruction.java 2009-04-15
20:29:00 UTC (rev 781)
@@ -32,10 +32,10 @@
import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.common.buffer.BlockedException;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.dqp.util.LogConstants;
import com.metamatrix.query.processor.ProcessorPlan;
import com.metamatrix.query.processor.program.ProgramEnvironment;
import com.metamatrix.query.sql.symbol.GroupSymbol;
-import com.metamatrix.query.util.LogConstants;
/**
* <p> Executes a SQL statement, and remove its results from the buffer manager.
Executing this
@@ -73,7 +73,7 @@
public void process(ProgramEnvironment env)
throws BlockedException, MetaMatrixComponentException,
MetaMatrixProcessingException {
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER, new Object[]{"Processing
ExecSqlInstruction as part of processing the update procedure"}); //$NON-NLS-1$
+ LogManager.logTrace(LogConstants.CTX_DQP, new Object[]{"Processing
ExecSqlInstruction as part of processing the update procedure"}); //$NON-NLS-1$
ProcedureEnvironment procEnv = (ProcedureEnvironment) env;
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/IfInstruction.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/IfInstruction.java 2009-04-15
20:21:58 UTC (rev 780)
+++
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/IfInstruction.java 2009-04-15
20:29:00 UTC (rev 781)
@@ -32,11 +32,11 @@
import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.common.buffer.BlockedException;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.dqp.util.LogConstants;
import com.metamatrix.query.processor.program.Program;
import com.metamatrix.query.processor.program.ProgramEnvironment;
import com.metamatrix.query.processor.program.ProgramInstruction;
import com.metamatrix.query.sql.lang.Criteria;
-import com.metamatrix.query.util.LogConstants;
/**
* <p>This instruction an holds an if block and an else block and a criteria that
determines
@@ -97,13 +97,13 @@
boolean evalValue = procEnv.evaluateCriteria(condition);
if(evalValue) {
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER, new
Object[]{"IFInstruction: "+ //$NON-NLS-1$
+ LogManager.logTrace(LogConstants.CTX_DQP, new Object[]{"IFInstruction:
"+ //$NON-NLS-1$
" The criteria on the if block evaluated to true, processing the if
block"}); //$NON-NLS-1$
//push the "if" Program onto the stack
procEnv.push(ifProgram);
} else if(elseProgram != null) {
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER, new
Object[]{"IFInstruction: "+ //$NON-NLS-1$
+ LogManager.logTrace(LogConstants.CTX_DQP, new Object[]{"IFInstruction:
"+ //$NON-NLS-1$
" The criteria on the if block evaluated to false, processing the else
block"}); //$NON-NLS-1$
//push the "else" Program onto the stack
procEnv.push(elseProgram);
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ProcedurePlan.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ProcedurePlan.java 2009-04-15
20:21:58 UTC (rev 780)
+++
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ProcedurePlan.java 2009-04-15
20:29:00 UTC (rev 781)
@@ -40,6 +40,7 @@
import com.metamatrix.common.buffer.TupleSourceNotFoundException;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.core.MetaMatrixCoreException;
+import com.metamatrix.dqp.util.LogConstants;
import com.metamatrix.query.eval.Evaluator;
import com.metamatrix.query.execution.QueryExecPlugin;
import com.metamatrix.query.metadata.QueryMetadataInterface;
@@ -60,7 +61,6 @@
import com.metamatrix.query.tempdata.TempTableStoreImpl;
import com.metamatrix.query.util.CommandContext;
import com.metamatrix.query.util.ErrorMessageKeys;
-import com.metamatrix.query.util.LogConstants;
/**
*/
public class ProcedurePlan extends BaseProcessorPlan {
@@ -126,7 +126,7 @@
env.getProgramStack().push(originalProgram);
}
env.reset();
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER, "ProcedurePlan reset");
//$NON-NLS-1$
+ LogManager.logTrace(LogConstants.CTX_DQP, "ProcedurePlan reset");
//$NON-NLS-1$
}
public ProcessorDataManager getDataManager() {
@@ -169,7 +169,7 @@
} catch (MetaMatrixComponentException e) {
throw new MetaMatrixComponentException(e, ErrorMessageKeys.PROCESSOR_0022,
QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0022, (String) null));
}
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER, new Object[]{"removed
tuple source", tupleSourceID, "for result set"}); //$NON-NLS-1$
//$NON-NLS-2$
+ LogManager.logTrace(LogConstants.CTX_DQP, new Object[]{"removed tuple
source", tupleSourceID, "for result set"}); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -251,23 +251,23 @@
Program program = env.peek();
inst = program.getCurrentInstruction();
if (inst == null){
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER, "Finished
program", program); //$NON-NLS-1$
+ LogManager.logTrace(LogConstants.CTX_DQP, "Finished program",
program); //$NON-NLS-1$
this.env.pop();
continue;
}
if (inst instanceof RepeatedInstruction) {
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER, "Executing repeated
instruction", inst); //$NON-NLS-1$
+ LogManager.logTrace(LogConstants.CTX_DQP, "Executing repeated
instruction", inst); //$NON-NLS-1$
RepeatedInstruction loop = (RepeatedInstruction)inst;
if (loop.testCondition(env)) {
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER, "Passed
condition, executing program " + loop.getNestedProgram()); //$NON-NLS-1$
+ LogManager.logTrace(LogConstants.CTX_DQP, "Passed condition,
executing program " + loop.getNestedProgram()); //$NON-NLS-1$
inst.process(env);
env.push(loop.getNestedProgram());
continue;
}
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER, "Exiting
repeated instruction", inst); //$NON-NLS-1$
+ LogManager.logTrace(LogConstants.CTX_DQP, "Exiting repeated
instruction", inst); //$NON-NLS-1$
loop.postInstruction(env);
} else {
- LogManager.logTrace(LogConstants.CTX_QUERY_PLANNER, "Executing
instruction", inst); //$NON-NLS-1$
+ LogManager.logTrace(LogConstants.CTX_DQP, "Executing instruction",
inst); //$NON-NLS-1$
inst.process(this.env);
}
program.incrementProgramCounter();