Package org.teiid.client

Examples of org.teiid.client.RequestMessage


        @Override
        public List<List> call() throws Exception {
          ArrayList<List> results = new ArrayList<List>();
         
          long start = System.currentTimeMillis();
          RequestMessage request = new RequestMessage(command);
          request.setExecutionId(0L);
          request.setRowLimit(getMaxRowsFetchSize()); // this would limit the number of rows that are returned.
          Future<ResultsMessage> message = dqpCore.executeRequest(requestID, request);
          ResultsMessage rm = message.get(timoutInMilli, TimeUnit.MILLISECONDS);
         
              if (rm.getException() != null) {
                  throw new AdminProcessingException(rm.getException());
View Full Code Here


          createResultSet(records, new String[] {show}, new String[] {JDBCSQLTypeInfo.STRING});
            return booleanFuture(true);
          }
        }
       
        final RequestMessage reqMessage = createRequestMessage(commands, isBatchedCommand, resultsMode);
        reqMessage.setSync(synch);
      ResultsFuture<ResultsMessage> pendingResult = execute(reqMessage, synch);
      final ResultsFuture<Boolean> result = new ResultsFuture<Boolean>();
      pendingResult.addCompletionListener(new ResultsFuture.CompletionListener<ResultsMessage>() {
        @Override
        public void onCompletion(ResultsFuture<ResultsMessage> future) {
View Full Code Here

        logger.fine(JDBCPlugin.Util.getString("MMStatement.Success_query", reqMessage.getCommandString())); //$NON-NLS-1$
  }

  protected RequestMessage createRequestMessage(String[] commands,
      boolean isBatchedCommand, ResultsMode resultsMode) {
        RequestMessage reqMessage = new RequestMessage();
      reqMessage.setCommands(commands);
      reqMessage.setBatchedUpdate(isBatchedCommand);
      reqMessage.setResultsMode(resultsMode);
    return reqMessage;
  }
View Full Code Here

    }
   
    @Override
    protected RequestMessage createRequestMessage(String[] commands,
        boolean isBatchedCommand, ResultsMode resultsMode) {
      RequestMessage message = super.createRequestMessage(commands, isBatchedCommand, resultsMode);
      message.setStatementType(StatementType.CALLABLE);
      return message;
    }
View Full Code Here

    QueryResolver.resolveCommand(command, metadata);
    return command;
  }

  static AtomicRequestMessage createNewAtomicRequestMessage(int requestid, int nodeid) throws Exception {
    RequestMessage rm = new RequestMessage();
   
    DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(EXAMPLE_BQT, FakeMetadataFactory.exampleBQTVDB());
    workContext.getSession().setSessionId(String.valueOf(1));
    workContext.getSession().setUserName("foo"); //$NON-NLS-1$
   
View Full Code Here

  static PreparedStatementRequest helpGetProcessorPlan(String preparedSql, List values,
      CapabilitiesFinder capFinder, QueryMetadataInterface metadata, SessionAwareCache<PreparedPlan> prepPlanCache, int conn, boolean callableStatement, boolean limitResults, VDBMetaData vdb)
      throws TeiidComponentException, TeiidProcessingException {
       
        //Create Request
        RequestMessage request = new RequestMessage(preparedSql);
        if (callableStatement) {
          request.setStatementType(StatementType.CALLABLE);
        } else {
          request.setStatementType(StatementType.PREPARED);
        }
        request.setParameterValues(values);
    if (values != null && values.size() > 0 && values.get(0) instanceof List) {
      request.setBatchedUpdate(true);
    }
        if (limitResults) {
          request.setRowLimit(1);
        }
      
        DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, vdb);
        workContext.getSession().setSessionId(String.valueOf(conn));
       
View Full Code Here

        DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, vdb);

        // Initialize components
        RequestID requestID = workContext.getRequestID(1)
        RequestMessage requestMsg = new RequestMessage(sql);
        TestDQPCoreRequestHandling.addRequest(requestMgr, requestMsg, requestID, command, null);
       
        MetaDataProcessor mdProc = new MetaDataProcessor(requestMgr, prepPlanCache, "MyVDB", 1);
                    
        return mdProc.processMessage(requestID, workContext, null, true).getColumnMetadata();   
View Full Code Here

        Collection<RequestMetadata> actualReqs = rm.getRequestsForSession(SESSION_STRING);
        compareReqInfos(reqs, actualReqs);
    }

  private RequestID addRequest(DQPCore rm, String sessionId, int executionId) {
    RequestMessage r0 = new RequestMessage("test command"); //$NON-NLS-1$
        RequestID id = new RequestID(sessionId, executionId);
        addRequest(rm, r0, id, null, null)
    return id;
  }
View Full Code Here

    }
       
    public void testAddRequest() {
        DQPCore rm = new DQPCore();
        rm.setTransactionService(new FakeTransactionService());
        RequestMessage r0 = new RequestMessage("foo"); //$NON-NLS-1$
        RequestID requestID = new RequestID(SESSION_STRING, 1);
        addRequest(rm, r0, requestID, null, null)
    }
View Full Code Here

    }
   
    public void testWarnings1() {
        DQPCore rm = new DQPCore();
        rm.setTransactionService(new FakeTransactionService());
        RequestMessage r0 = new RequestMessage("foo"); //$NON-NLS-1$
        RequestID requestID = new RequestID(SESSION_STRING, 1);

        RequestWorkItem workItem = addRequest(rm, r0, requestID, null, null);
               
        workItem.addSourceFailureDetails(getSourceFailures("Model1", "Binding1", "Warning1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
View Full Code Here

TOP

Related Classes of org.teiid.client.RequestMessage

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.