Package org.teiid.dqp.message

Examples of org.teiid.dqp.message.AtomicResultsMessage


          "Could not process stored procedure results for EXEC spTest8(1).  Expected 2 result set columns, but was 1.  Please update your models to allow for stored procedure results batching.", err.getMessage()); //$NON-NLS-1$
    }
  }

    @Test public void testUpdateExecution() throws Throwable {
    AtomicResultsMessage results = helpExecuteUpdate();
    assertEquals(Integer.valueOf(1), results.getResults()[0].get(0));
  }
View Full Code Here


    ConnectorWorkItem synchConnectorWorkItem = new ConnectorWorkItem(arm, TestConnectorManager.getConnectorManager());
    return synchConnectorWorkItem.execute();
  }
 
  @Test public void testExecutionWarning() throws Throwable {
    AtomicResultsMessage results = helpExecuteUpdate();
    assertEquals(1, results.getWarnings().size());
  }
View Full Code Here

        List[] results = createResults(projectedSymbols);
        if (RelationalNodeUtil.isUpdate(message.getCommand())) {
          results = new List[] {Arrays.asList(1)};
        }
               
        final AtomicResultsMessage msg = ConnectorWorkItem.createResultsMessage(results, projectedSymbols);
        msg.setFinalRow(rows);
        return new ConnectorWork() {
     
      @Override
      public AtomicResultsMessage more() throws TranslatorException {
        throw new RuntimeException("Should not be called"); //$NON-NLS-1$
View Full Code Here

  }

    public List<?> nextTuple() throws TeiidComponentException, TeiidProcessingException {
      while (true) {
        if (arm == null) {
          AtomicResultsMessage results = null;
          try {
            if (futureResult != null || !aqr.isSerial()) {
              results = asynchGet();
            } else {
              results = getResults();
View Full Code Here

    if (!futureResult.isDone()) {
      throw BlockedException.INSTANCE;
    }
    FutureWork<AtomicResultsMessage> currentResults = futureResult;
    futureResult = null;
    AtomicResultsMessage results = null;
    try {
      results = currentResults.get();
      if (results.getFinalRow() < 0) {
        addWork();
      }
    } catch (InterruptedException e) {
      throw new TeiidRuntimeException(e);
    } catch (ExecutionException e) {
View Full Code Here

  }

  private AtomicResultsMessage getResults()
      throws BlockedException, TeiidComponentException,
      TranslatorException {
    AtomicResultsMessage results = null;
    if (cancelAsynch) {
      return null;
    }
    running = true;
    if (!executed) {
View Full Code Here

    AtomicResultsMessage exceptionOccurred(TranslatorException exception, boolean removeState) throws TeiidComponentException, TeiidProcessingException {
      if (removeState) {
      fullyCloseSource();
    }
      if(workItem.requestMsg.supportsPartialResults()) {
      AtomicResultsMessage emptyResults = new AtomicResultsMessage(new List[0], null);
      emptyResults.setWarnings(Arrays.asList((Exception)exception));
      emptyResults.setFinalRow(this.rowsProcessed);
      return emptyResults;
    }
    if (exception.getCause() instanceof TeiidComponentException) {
      throw (TeiidComponentException)exception.getCause();
    }
View Full Code Here

        // Defect 13366 - Should send all batches, even if they're zero size.
        // Log warning if received a zero-size non-last batch from the connector.
        LogManager.logWarning(LogConstants.CTX_CONNECTOR, QueryPlugin.Util.getString("ConnectorWorker.zero_size_non_last_batch", requestMsg.getConnectorName())); //$NON-NLS-1$
    }

    AtomicResultsMessage response = createResultsMessage(rows.toArray(new List[currentRowCount]), requestMsg.getCommand().getProjectedSymbols());
   
    // if we need to keep the execution alive, then we can not support implicit close.
    response.setSupportsImplicitClose(!this.securityContext.keepExecutionAlive());
    response.setTransactional(this.securityContext.isTransactional());
    response.setWarnings(this.securityContext.getWarnings());
    response.setSupportsCloseWithLobs(this.connector.areLobsUsableAfterClose());

    if ( lastBatch ) {
        response.setFinalRow(rowCount);
    }
    return response;
  }
View Full Code Here

    return response;
  }

    public static AtomicResultsMessage createResultsMessage(List[] batch, List columnSymbols) {
        String[] dataTypes = TupleBuffer.getTypeNames(columnSymbols);       
        return new AtomicResultsMessage(batch, dataTypes);
    }   
View Full Code Here

TOP

Related Classes of org.teiid.dqp.message.AtomicResultsMessage

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.