Package org.teiid.dqp.service

Examples of org.teiid.dqp.service.FakeBufferService


@SuppressWarnings({"nls", "unchecked"})
public class TestCachedResults {
 
  @Test
  public void testCaching() throws Exception {
    FakeBufferService fbs = new FakeBufferService();
   
    ElementSymbol x = new ElementSymbol("x"); //$NON-NLS-1$
    x.setType(DataTypeManager.DefaultDataClasses.INTEGER);
    List<ElementSymbol> schema = Arrays.asList(x);
    TupleBuffer tb = new TupleBuffer(new FakeBatchManager(), "x", schema, null, 4); //$NON-NLS-1$
    tb.setForwardOnly(false);
   
    tb.addTuple(Arrays.asList(1))
    tb.addTuple(Arrays.asList(2));
    tb.addTuple(Arrays.asList(3));
    tb.addTuple(Arrays.asList(4));
    tb.addTuple(Arrays.asList(5));
    tb.addTuple(Arrays.asList(6));
    tb.addTuple(Arrays.asList(7));
    tb.addTuple(Arrays.asList(8));
    tb.addTuple(Arrays.asList(9));
    tb.addTuple(Arrays.asList(10));
   
    tb.close();
   
    BufferManager bm = fbs.getBufferManager();
    CachedResults results = new CachedResults();
    ProcessorPlan plan = new FakeProcessorPlan(0);
    CommandContext cc = new CommandContext();
    Table t = RealMetadataFactory.exampleBQT().getGroupID("bqt1.smalla");
    cc.accessedDataObject(t);
View Full Code Here


        QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
        DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, FakeMetadataFactory.exampleBQTVDB());
       
        rm = new DQPCore();
        rm.setTransactionService(new FakeTransactionService());
        rm.setBufferService(new FakeBufferService());
        rm.setCacheFactory(new DefaultCacheFactory());
        rm.start(new DQPConfiguration());
        FakeBufferService bs = new FakeBufferService();

        ConnectorManagerRepository repo = Mockito.mock(ConnectorManagerRepository.class);
        Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(connectorManager);
       
       
        dtm = new DataTierManagerImpl(rm,
                                  bs, true);
        command = helpGetCommand(sql, metadata);
       
        RequestMessage original = new RequestMessage();
        original.setExecutionId(1);
        original.setPartialResults(true);
        RequestID requestID = workContext.getRequestID(original.getExecutionId());
       
        context = new CommandContext();
        context.setProcessorID(requestID);
        context.setVdbName("test"); //$NON-NLS-1$
        context.setVdbVersion(1);
        context.setQueryProcessorFactory(new QueryProcessorFactoryImpl(bs.getBufferManager(), dtm, new DefaultCapabilitiesFinder(), null, metadata));
        workItem = TestDQPCoreRequestHandling.addRequest(rm, original, requestID, null, workContext);
       
        request = new AtomicRequestMessage(original, workContext, nodeId);
        request.setCommand(command);
        request.setConnectorName("FakeConnectorID"); //$NON-NLS-1$
View Full Code Here

    this.repo.setSystemFunctionManager(new SystemFunctionManager());
    this.repo.odbcEnabled();
    this.repo.start();
   
        this.sessionService.setVDBRepository(repo);
        this.dqp.setBufferService(new FakeBufferService());
        this.dqp.setCacheFactory(new DefaultCacheFactory());
        this.dqp.setTransactionService(new FakeTransactionService());
       
        cmr = Mockito.mock(ConnectorManagerRepository.class);
        Mockito.stub(cmr.getConnectorManager("source")).toReturn(new ConnectorManager("x", "x") {
View Full Code Here

TOP

Related Classes of org.teiid.dqp.service.FakeBufferService

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.