Package org.teiid.query.processor

Examples of org.teiid.query.processor.QueryProcessor


        Command command = helpGetCommand("SELECT * FROM xmltest.doc6", metadata); //$NON-NLS-1$
        XMLPlan plan = TestXMLPlanner.preparePlan(command, metadata, new DefaultCapabilitiesFinder(), null);

        BufferManager bufferMgr = BufferManagerFactory.getStandaloneBufferManager();
        CommandContext context = new CommandContext("pID", null, null, null, 1);                                 //$NON-NLS-1$
        QueryProcessor processor = new QueryProcessor(plan, context, bufferMgr, dataMgr);
        processor.setNonBlocking(true);
        BatchCollector collector = processor.createBatchCollector();
        TeiidComponentException failOnDefaultException = null;
        try{
            collector.collectTuples();
        } catch (TeiidComponentException e){
            failOnDefaultException = e;
View Full Code Here


    public void helpTestProcessor(FakeProcessorPlan plan, long timeslice, List[] expectedResults) throws TeiidException {
        BufferManager bufferMgr = BufferManagerFactory.getStandaloneBufferManager();
        FakeDataManager dataManager = new FakeDataManager();

        CommandContext context = new CommandContext("pid", "group", null, null, 1); //$NON-NLS-1$ //$NON-NLS-2$
        QueryProcessor processor = new QueryProcessor(plan, context, bufferMgr, dataManager);
        BatchCollector collector = processor.createBatchCollector();
        TupleBuffer tsID = null;
        while(true) {
            try {
                tsID = collector.collectTuples();        
                break;
View Full Code Here

    Option option = new Option();
    option.setNoCache(true);
    option.addNoCacheGroup(fullName);
    proc.setOption(option);
    Determinism determinismLevel = context.resetDeterminismLevel();
    QueryProcessor qp = context.getQueryProcessorFactory().createQueryProcessor(proc.toString(), fullName.toUpperCase(), context);
    qp.setNonBlocking(true);
    qp.getContext().setDataObjects(null);
    BatchCollector bc = qp.createBatchCollector();
    TupleBuffer tb = bc.collectTuples();
    CachedResults cr = new CachedResults();
    cr.setResults(tb, qp.getProcessorPlan());
    cr.setHint(hint);
    if (hint != null && hint.getDeterminism() != null) {
      LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Cache hint modified the query determinism from ",determinismLevel, " to ", hint.getDeterminism() }); //$NON-NLS-1$ //$NON-NLS-2$
      determinismLevel = hint.getDeterminism();
    }
View Full Code Here

      }
      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

      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

   
            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

          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

    }   
  }

  @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

        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

        }
        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

TOP

Related Classes of org.teiid.query.processor.QueryProcessor

Copyright © 2018 www.massapicom. 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.