/** * @see java.lang.Object#clone() * @since 4.2 */ public BatchedUpdatePlan clone() { List<ProcessorPlan> clonedPlans = new ArrayList<ProcessorPlan>(updatePlans.length); clonedPlans.add(updatePlans[0].clone()); for (int i = 1; i <updatePlans.length; i++) { if (contexts == null) { clonedPlans.add(updatePlans[1].clone()); } else { clonedPlans.add(clonedPlans.get(0)); } } BatchedUpdatePlan clone = new BatchedUpdatePlan(clonedPlans, updateCounts.length, contexts, singleResult); return clone; }
/** * Returns a deep clone */ public LoopInstruction clone(){ ProcessorPlan clonedPlan = this.plan.clone(); return new LoopInstruction(this.loopProgram.clone(), this.rsName, clonedPlan, label); }
/** * Returns a deep clone */ public CreateCursorResultSetInstruction clone(){ ProcessorPlan clonedPlan = this.plan.clone(); CreateCursorResultSetInstruction clone = new CreateCursorResultSetInstruction(this.rsName, clonedPlan, mode); clone.setProcAssignments(procAssignments); clone.usesLocalTemp = true; return clone; }
/** * Returns a deep clone */ public CreateCursorResultSetInstruction clone(){ ProcessorPlan clonedPlan = this.plan.clone(); CreateCursorResultSetInstruction clone = new CreateCursorResultSetInstruction(this.rsName, clonedPlan, mode); clone.setProcAssignments(procAssignments); clone.usesLocalTemp = true; return clone; }
/** * Returns a deep clone */ public LoopInstruction clone(){ ProcessorPlan clonedPlan = this.plan.clone(); return new LoopInstruction(this.loopProgram.clone(), this.rsName, clonedPlan, label); }
/** * Returns a deep clone */ public LoopInstruction clone(){ ProcessorPlan clonedPlan = this.plan.clone(); return new LoopInstruction(this.loopProgram.clone(), this.rsName, clonedPlan, label); }
/** * Returns a deep clone */ public CreateCursorResultSetInstruction clone(){ ProcessorPlan clonedPlan = this.plan.clone(); CreateCursorResultSetInstruction clone = new CreateCursorResultSetInstruction(this.rsName, clonedPlan, mode); clone.setProcAssignments(procAssignments); clone.usesLocalTemp = true; return clone; }
protected void copyTo(PlanExecutionNode target) { target.setProcessorPlan(plan.clone()); super.copyTo(target); }
protected void copyTo(PlanExecutionNode target) { target.setProcessorPlan(plan.clone()); super.copyTo(target); }
protected void copyTo(PlanExecutionNode target) { target.setProcessorPlan(plan.clone()); super.copyTo(target); }
public PlanExecutor createResultExecutor(ResultSetInfo info) { // cloning the plan inside the resultset is not possible // because of the dependencies. ResultSetInfo clone = (ResultSetInfo)info.clone(); ProcessorPlan plan = clone.getPlan(); plan = plan.clone(); clone.setPlan(plan); return new RelationalPlanExecutor(clone, this.commandContext, this.dataMgr, this.bufferMgr); }
@Override public ProcessorPlan clone() { ForEachRowPlan clone = new ForEachRowPlan(); clone.setQueryPlan(queryPlan.clone()); clone.setRowProcedure((ProcedurePlan) rowProcedure.clone()); clone.setParams(params); clone.setLookupMap(lookupMap); return clone; }
@Override public ProcessorPlan clone() { ForEachRowPlan clone = new ForEachRowPlan(); clone.setQueryPlan(queryPlan.clone()); clone.setRowProcedure((ProcedurePlan) rowProcedure.clone()); clone.setParams(params); clone.setLookupMap(lookupMap); return clone; }
@Override public ProcessorPlan clone() { ForEachRowPlan clone = new ForEachRowPlan(); clone.setQueryPlan(queryPlan.clone()); clone.setRowProcedure((ProcedurePlan) rowProcedure.clone()); clone.setParams(params); clone.setLookupMap(lookupMap); return clone; }
public RelationalPlan clone(){ RelationalPlan plan = new RelationalPlan((RelationalNode)root.clone()); plan.setOutputElements(outputCols); if (with != null) { List<WithQueryCommand> newWith = LanguageObject.Util.deepClone(this.with, WithQueryCommand.class); for (WithQueryCommand withQueryCommand : newWith) { if (withQueryCommand.isRecursive()) { SetQuery setQuery = (SetQuery)withQueryCommand.getCommand(); setQuery.getLeftQuery().setProcessorPlan(setQuery.getLeftQuery().getProcessorPlan().clone()); setQuery.getRightQuery().setProcessorPlan(setQuery.getRightQuery().getProcessorPlan().clone()); } else { withQueryCommand.getCommand().setProcessorPlan(withQueryCommand.getCommand().getProcessorPlan().clone()); } } plan.setWith(newWith); } return plan; }
public RelationalPlan clone(){ RelationalPlan plan = new RelationalPlan((RelationalNode)root.clone()); plan.setOutputElements(outputCols); if (with != null) { List<WithQueryCommand> newWith = LanguageObject.Util.deepClone(this.with, WithQueryCommand.class); for (WithQueryCommand withQueryCommand : newWith) { if (withQueryCommand.isRecursive()) { SetQuery setQuery = (SetQuery)withQueryCommand.getCommand(); setQuery.getLeftQuery().setProcessorPlan(setQuery.getLeftQuery().getProcessorPlan().clone()); setQuery.getRightQuery().setProcessorPlan(setQuery.getRightQuery().getProcessorPlan().clone()); } else { withQueryCommand.getCommand().setProcessorPlan(withQueryCommand.getCommand().getProcessorPlan().clone()); } } plan.setWith(newWith); } return plan; }
@Override public QueryProcessor createQueryProcessor(String query, String recursionGroup, CommandContext commandContext, Object... params) throws TeiidProcessingException, TeiidComponentException { CommandContext copy = commandContext.clone(); copy.resetDeterminismLevel(true); copy.setDataObjects(null); QueryMetadataInterface metadata = commandContext.getMetadata(); if (metadata == null) { metadata = defaultMetadata; } PreparedPlan pp = getPreparedPlan(query, recursionGroup, copy, metadata); copy.pushVariableContext(new VariableContext()); PreparedStatementRequest.resolveParameterValues(pp.getReferences(), Arrays.asList(params), copy, metadata); return new QueryProcessor(pp.getPlan().clone(), copy, bufferMgr, dataMgr); }
@Override public QueryProcessor createQueryProcessor(String query, String recursionGroup, CommandContext commandContext, Object... params) throws TeiidProcessingException, TeiidComponentException { CommandContext copy = commandContext.clone(); copy.resetDeterminismLevel(true); copy.setDataObjects(null); QueryMetadataInterface metadata = commandContext.getMetadata(); if (metadata == null) { metadata = defaultMetadata; } PreparedPlan pp = getPreparedPlan(query, recursionGroup, copy, metadata); copy.pushVariableContext(new VariableContext()); PreparedStatementRequest.resolveParameterValues(pp.getReferences(), Arrays.asList(params), copy, metadata); return new QueryProcessor(pp.getPlan().clone(), copy, bufferMgr, dataMgr); }
@Override public QueryProcessor createQueryProcessor(String query, String recursionGroup, CommandContext commandContext, Object... params) throws TeiidProcessingException, TeiidComponentException { CommandContext copy = commandContext.clone(); copy.resetDeterminismLevel(true); copy.setDataObjects(null); QueryMetadataInterface metadata = commandContext.getMetadata(); if (metadata == null) { metadata = defaultMetadata; } PreparedPlan pp = getPreparedPlan(query, recursionGroup, copy, metadata); copy.pushVariableContext(new VariableContext()); PreparedStatementRequest.resolveParameterValues(pp.getReferences(), Arrays.asList(params), copy, metadata); return new QueryProcessor(pp.getPlan().clone(), copy, bufferMgr, dataMgr); }
public static void helpProcess(ProcessorPlan plan, CommandContext context, ProcessorDataManager dataManager, List[] expectedResults) throws Exception { ProcessorPlan clonePlan = plan.clone(); // Process twice to test reset and clone doProcess(plan, dataManager, expectedResults, context); plan.reset(); doProcess(plan, dataManager, expectedResults, context); // Execute cloned of original plan doProcess(clonePlan, dataManager, expectedResults, context); }