Examples of processCursorRequest()


Examples of org.teiid.client.DQP.processCursorRequest()

    stub(statement.getFetchSize()).toReturn(fetchSize);
    for (int i = batchLength; i < totalLength; i += batchLength) {
      //forward requests
      ResultsFuture<ResultsMessage> nextBatch = mock(ResultsFuture.class);
      stub(nextBatch.get(Matchers.anyLong(), (TimeUnit)Matchers.anyObject())).toReturn(exampleResultsMsg4(i + 1, Math.min(batchLength, totalLength - i), fetchSize, i + batchLength >= totalLength));
      stub(dqp.processCursorRequest(REQUEST_ID, i + 1, fetchSize)).toReturn(nextBatch);
     
      if (i + batchLength < totalLength) {
        //backward requests
        ResultsFuture<ResultsMessage> previousBatch = mock(ResultsFuture.class);
        stub(previousBatch.get(Matchers.anyLong(), (TimeUnit)Matchers.anyObject())).toReturn(exampleResultsMsg4(i - batchLength + 1, i, fetchSize, false));
View Full Code Here

Examples of org.teiid.client.DQP.processCursorRequest()

     
      if (i + batchLength < totalLength) {
        //backward requests
        ResultsFuture<ResultsMessage> previousBatch = mock(ResultsFuture.class);
        stub(previousBatch.get(Matchers.anyLong(), (TimeUnit)Matchers.anyObject())).toReturn(exampleResultsMsg4(i - batchLength + 1, i, fetchSize, false));
        stub(dqp.processCursorRequest(REQUEST_ID, i, fetchSize)).toReturn(previousBatch);
      }
    }
   
    ResultsMessage msg = exampleResultsMsg4(1, batchLength, fetchSize, batchLength == totalLength);
    return new ResultSetImpl(msg, statement, new ResultSetMetaDataImpl(new MetadataProvider(DeferredMetadataProvider.loadPartialMetadata(msg.getColumnNames(), msg.getDataTypes()))), 0);
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.