Examples of QueryProcessor


Examples of org.teiid.query.processor.QueryProcessor

      }
      Constant key = (Constant)proc.getParameter(2).getExpression();
      LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.getString("TempTableDataManager.row_refresh", matViewName, key)); //$NON-NLS-1$
      String queryString = Reserved.SELECT + " * " + Reserved.FROM + ' ' + matViewName + ' ' + Reserved.WHERE + ' ' + //$NON-NLS-1$
        metadata.getFullName(ids.iterator().next()) + " = ?" + ' ' + Reserved.OPTION + ' ' + Reserved.NOCACHE; //$NON-NLS-1$
      QueryProcessor qp = context.getQueryProcessorFactory().createQueryProcessor(queryString, matViewName.toUpperCase(), context, key.getValue());
      qp.setNonBlocking(true);
      qp.getContext().setDataObjects(null);
      TupleSource ts = new BatchCollector.BatchProducerTupleSource(qp);
      List<?> tuple = ts.nextTuple();
      boolean delete = false;
      if (tuple == null) {
        delete = true;
View Full Code Here

Examples of org.teiid.query.processor.QueryProcessor

      if (ts == null) {
        variables = allColumns;
        //TODO: coordinate a distributed load
        //TODO: order by primary key nulls first - then have an insert ordered optimization
        String transformation = metadata.getVirtualPlan(group.getMetadataID()).getQuery();
        QueryProcessor qp = context.getQueryProcessorFactory().createQueryProcessor(transformation, fullName, context);
        qp.setNonBlocking(true);
        qp.getContext().setDataObjects(null);
        if (distributedCache != null) {
          CachedResults cr = new CachedResults();
          BatchCollector bc = qp.createBatchCollector();
          TupleBuffer tb = bc.collectTuples();
          cr.setResults(tb, qp.getProcessorPlan());
          touchTable(context, fullName, true);
          this.distributedCache.put(cid, Determinism.VDB_DETERMINISTIC, cr, info.getTtl());
          ts = tb.createIndexedTupleSource();
        } else {
          ts = new BatchCollector.BatchProducerTupleSource(qp);
View Full Code Here

Examples of org.teiid.query.processor.QueryProcessor

   
            CommandContext subContext = getContext().clone();
            subContext.setVariableContext(this.currentVarContext);
            subContext.setTempTableStore(getTempTableStore());
            state = new CursorState();
            state.processor = new QueryProcessor(command, subContext, this.bufferMgr, this.dataMgr);
            state.ts = new BatchIterator(state.processor);
            if (procAssignments != null && state.processor.getOutputElements().size() - procAssignments.size() > 0) {
              state.resultsBuffer = bufferMgr.createTupleBuffer(state.processor.getOutputElements().subList(0, state.processor.getOutputElements().size() - procAssignments.size()), getContext().getConnectionID(), TupleSourceType.PROCESSOR);
            }
              this.currentState = state;
View Full Code Here

Examples of org.teiid.query.processor.QueryProcessor

          return result;
        }
      }
      if (this.rowProcessor == null) {
        rowProcedure.reset();
        this.rowProcessor = new QueryProcessor(rowProcedure, getContext(), this.bufferMgr, this.dataMgr);
        for (Map.Entry<ElementSymbol, Expression> entry : this.params.entrySet()) {
          Integer index = (Integer)this.lookupMap.get(entry.getValue());
          if (index != null) {
            rowProcedure.getCurrentVariableContext().setValue(entry.getKey(), this.currentTuple.get(index));
          } else {
View Full Code Here

Examples of org.teiid.query.processor.QueryProcessor

    }   
  }

  @Override
  public void open() throws TeiidComponentException, TeiidProcessingException {
    queryProcessor = new QueryProcessor(queryPlan, getContext(), this.bufferMgr, this.dataMgr);
    tupleSource = new BatchCollector.BatchProducerTupleSource(queryProcessor);
  }
View Full Code Here

Examples of org.teiid.query.processor.QueryProcessor

        this.bufferMgr = bufferMgr;
       
        ProcessorPlan plan = resultInfo.getPlan();
        CommandContext subContext = context.clone();
        subContext.pushVariableContext(new VariableContext());
        this.internalProcessor = new QueryProcessor(plan, subContext, bufferMgr, dataMgr);
    }
View Full Code Here

Examples of org.teiid.query.processor.QueryProcessor

        }
        while (!withToProcess.isEmpty()) {
          WithQueryCommand withCommand = withToProcess.get(0);
          if (withProcessor == null) {
              ProcessorPlan plan = withCommand.getCommand().getProcessorPlan();
          withProcessor = new QueryProcessor(plan, getContext(), this.root.getBufferManager(), this.root.getDataManager());
          Create create = new Create();
          create.setElementSymbolsAsColumns(withCommand.getColumns());
          create.setTable(withCommand.getGroupSymbol());
          this.root.getDataManager().registerRequest(getContext(), create, TempMetadataAdapter.TEMP_MODEL.getID(), null, 0, -1);
          }
View Full Code Here

Examples of org.teiid.query.processor.QueryProcessor

    }
    if (!state.done) {
      if (state.processor == null) {
        CommandContext subContext = context.clone();
        state.plan.reset();
            state.processor = new QueryProcessor(state.plan, subContext, manager, this.dataMgr);
            if (currentContext != null) {
              state.processor.getContext().pushVariableContext(currentContext);
            }
            state.collector = state.processor.createBatchCollector();
      }
View Full Code Here

Examples of org.teiid.query.processor.QueryProcessor

                }
            }
        }
       
        this.transactionContext = tc;
        this.processor = new QueryProcessor(processPlan, context, bufferManager, processorDataManager);
    }
View Full Code Here

Examples of org.teiid.query.processor.QueryProcessor

          commandContext.putPlan(query, pp, copy.getDeterminismLevel());
          copy.setDeterminismLevel(determinismLevel);
    }
    copy.pushVariableContext(new VariableContext());
    PreparedStatementRequest.resolveParameterValues(pp.getReferences(), Arrays.asList(params), copy, metadata);
        return new QueryProcessor(pp.getPlan().clone(), copy, bufferMgr, dataMgr);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.