Package org.teiid.metadata.FunctionMethod

Examples of org.teiid.metadata.FunctionMethod.Determinism


    proc.setCacheHint(null);
    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();
View Full Code Here


        }
        String fullName = metadata.getFullName(pid);
        fullName = "procedure cache:" + fullName; //$NON-NLS-1$
        PreparedPlan pp = context.getPlan(fullName);
        if (pp == null) {
          Determinism determinismLevel = context.resetDeterminismLevel();
          CommandContext clone = context.clone();
          ProcessorPlan plan = planProcedure(command, metadata, idGenerator, capFinder, analysisRecord, clone);
          //note that this is not a full prepared plan.  It is not usable by user queries.
          if (pid instanceof Procedure) {
            clone.accessedPlanningObject(pid);
View Full Code Here

 
  private void addToCache() {
    if (!doneProducingBatches || cid == null) {
      return;
    }
      Determinism determinismLevel = processor.getContext().getDeterminismLevel();
      CachedResults cr = new CachedResults();
      cr.setCommand(originalCommand);
        cr.setAnalysisRecord(analysisRecord);
        cr.setResults(resultsBuffer, processor.getProcessorPlan());
        if (originalCommand.getCacheHint() != null) {
          LogManager.logDetail(LogConstants.CTX_DQP, requestID, "Using cache hint", originalCommand.getCacheHint()); //$NON-NLS-1$
      resultsBuffer.setPrefersMemory(originalCommand.getCacheHint().getPrefersMemory());
          if (originalCommand.getCacheHint().getDeterminism() != null) {
        determinismLevel = originalCommand.getCacheHint().getDeterminism();
        LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Cache hint modified the query determinism from ",processor.getContext().getDeterminismLevel(), " to ", determinismLevel }); //$NON-NLS-1$ //$NON-NLS-2$
          }                   
        }               
       
        if (determinismLevel.compareTo(Determinism.SESSION_DETERMINISTIC) <= 0) {
      LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.getString("RequestWorkItem.cache_nondeterministic", originalCommand)); //$NON-NLS-1$
    }
        dqpCore.getRsCache().put(cid, determinismLevel, cr, originalCommand.getCacheHint() != null?originalCommand.getCacheHint().getTtl():null);
  }
View Full Code Here

              prepPlan.setCommand(this.userCommand);
            // Defect 13751: Clone the plan in its current state (i.e. before processing) so that it can be used for later queries
            prepPlan.setPlan(processPlan.clone(), this.context);
            prepPlan.setAnalysisRecord(analysisRecord);
       
            Determinism determinismLevel = this.context.getDeterminismLevel();
        if (userCommand.getCacheHint() != null && userCommand.getCacheHint().getDeterminism() != null) {
          LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Cache hint modified the query determinism from ",this.context.getDeterminismLevel(), " to ", determinismLevel }); //$NON-NLS-1$ //$NON-NLS-2$
          determinismLevel = userCommand.getCacheHint().getDeterminism();
        }           
           
View Full Code Here

         
          List<Reference> references = ReferenceCollectorVisitor.getReferences(newCommand);
         
          AbstractValidationVisitor visitor = new ValidationVisitor();
          Request.validateWithVisitor(visitor, metadata, newCommand);
          Determinism determinismLevel = copy.resetDeterminismLevel();
          newCommand = QueryRewriter.rewrite(newCommand, metadata, copy);
          AnalysisRecord record = new AnalysisRecord(false, false);
          ProcessorPlan plan = QueryOptimizer.optimizePlan(newCommand, metadata, idGenerator, finder, record, copy);
          pp = new PreparedPlan();
          pp.setPlan(plan, copy);
View Full Code Here

    public Determinism getDeterminismLevel() {
    return globalState.determinismLevel;
  }
   
    public Determinism resetDeterminismLevel() {
      Determinism result = globalState.determinismLevel;
      globalState.determinismLevel = Determinism.DETERMINISTIC;
      return result;
    }
View Full Code Here

TOP

Related Classes of org.teiid.metadata.FunctionMethod.Determinism

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.