Package org.teiid.common.buffer

Examples of org.teiid.common.buffer.BufferManager


    public TestProjectNode(String arg0) {
        super(arg0);
    }
   
    public ProjectNode helpSetupProject(List elements, List[] data, List childElements, ProcessorDataManager dataMgr) throws TeiidComponentException {
        BufferManager mgr = BufferManagerFactory.getStandaloneBufferManager();
        CommandContext context = new CommandContext("pid", "test", null, null, 1);               //$NON-NLS-1$ //$NON-NLS-2$
       
        FakeRelationalNode dataNode = new FakeRelationalNode(2, data);
        dataNode.setElements(childElements);
        dataNode.initialize(context, mgr, null);   
View Full Code Here


/**
*/
public class TestUnionAllNode {

    public void helpTestUnion(RelationalNode[] children, RelationalNode union, List[] expected) throws TeiidComponentException, TeiidProcessingException {
        BufferManager mgr = NodeTestUtil.getTestBufferManager(1, 2);
        CommandContext context = new CommandContext("pid", "test", null, null, 1);               //$NON-NLS-1$ //$NON-NLS-2$
        FakeDataManager fdm = new FakeDataManager();
        for(int i=0; i<children.length; i++) {
            union.addChild(children[i]);
            children[i].initialize(context, mgr, fdm);
View Full Code Here

        // Setup
        AccessNode node = new AccessNode(1);
        node.setCommand(command);
        CommandContext context = new CommandContext();
        context.setProcessorID("processorID"); //$NON-NLS-1$
        BufferManager bm = BufferManagerFactory.getStandaloneBufferManager();
        FakeDataManager dataManager = new FakeDataManager();
        TestProcessor.sampleData1(dataManager);
        node.setElements(command.getProjectedSymbols());
        node.initialize(context, bm, dataManager);
        node.setShouldEvaluateExpressions(true);
View Full Code Here

        AccessNode node = new AccessNode(1);
      Query query = (Query)TestResolver.helpResolve("SELECT e1, e2 FROM pm1.g1 WHERE e2 = 5", FakeMetadataFactory.example1Cached()); //$NON-NLS-1$
        node.setCommand(query);
        CommandContext context = new CommandContext();
        context.setProcessorID("processorID"); //$NON-NLS-1$
        BufferManager bm = BufferManagerFactory.getStandaloneBufferManager();
        FakeDataManager dataManager = new FakeDataManager();
        TestProcessor.sampleData1(dataManager);
        node.setElements(query.getProjectedSymbols());
        node.initialize(context, bm, dataManager);
        // Call open()
View Full Code Here

        finder.addCapabilities("Europe", caps);//$NON-NLS-1$
        finder.addCapabilities("CustomerMaster", caps);//$NON-NLS-1$
        ProcessorPlan plan = TestProcessor.helpGetPlan(command, exampleVirtualDepJoin(), finder, context);
        // Run query
        BufferManager bufferMgr = createCustomBufferMgr(2);
        QueryProcessor processor = new QueryProcessor(plan, context, bufferMgr, dataManager);
        processor.setNonBlocking(true);
        BatchCollector collector = processor.createBatchCollector();
        TupleBuffer id = collector.collectTuples();
View Full Code Here

public class TestSortNode {
   
    public static final int BATCH_SIZE = 100;
   
    private void helpTestSort(List elements, List[] data, List sortElements, List sortTypes, List[] expected, Mode mode) throws TeiidComponentException, TeiidProcessingException {
        BufferManager mgr = NodeTestUtil.getTestBufferManager(100, BATCH_SIZE, BATCH_SIZE);
        CommandContext context = new CommandContext ("pid", "test", null, null, 1);               //$NON-NLS-1$ //$NON-NLS-2$
       
        BlockingFakeRelationalNode dataNode = new BlockingFakeRelationalNode(2, data);
        dataNode.setReturnPeriod(3);
        dataNode.setElements(elements);
View Full Code Here

    }      
   
    @Test public void testDupRemove() throws Exception {
      ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
        es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);
        BufferManager bm = BufferManagerFactory.getStandaloneBufferManager();
        TupleBuffer tsid = bm.createTupleBuffer(Arrays.asList(es1), "test", TupleSourceType.PROCESSOR); //$NON-NLS-1$
        tsid.addTuple(Arrays.asList(1));
      SortUtility su = new SortUtility(tsid.createIndexedTupleSource(), Arrays.asList(es1), Arrays.asList(Boolean.TRUE), Mode.DUP_REMOVE, bm, "test", tsid.getSchema()); //$NON-NLS-1$
      TupleBuffer out = su.sort();
      TupleSource ts = out.createIndexedTupleSource();
      assertEquals(Arrays.asList(1), ts.nextTuple());
View Full Code Here

    public TestDuplicateFilter(String arg0) {
        super(arg0);
    }
   
    public void helpTestDuplicateFilter(Object[] input, Class dataType, int expected) throws TeiidComponentException, TeiidProcessingException {
        BufferManager mgr = BufferManagerFactory.getStandaloneBufferManager();
       
        SortingFilter filter = new SortingFilter(new Count(), mgr, "test", true); //$NON-NLS-1$
        filter.initialize(dataType, dataType);
        ElementSymbol element = new ElementSymbol("val"); //$NON-NLS-1$
        element.setType(dataType);
View Full Code Here

        FakeDataManager dataMgr = exampleDataManagerDuJour(metadata);
       
        Command command = helpGetCommand("SELECT * FROM xmltest.doc6", metadata); //$NON-NLS-1$
        XMLPlan plan = TestXMLPlanner.preparePlan(command, metadata, new DefaultCapabilitiesFinder(), null);

        BufferManager bufferMgr = BufferManagerFactory.getStandaloneBufferManager();
        CommandContext context = new CommandContext("pID", null, null, null, 1);                                 //$NON-NLS-1$
        QueryProcessor processor = new QueryProcessor(plan, context, bufferMgr, dataMgr);
        processor.setNonBlocking(true);
        BatchCollector collector = processor.createBatchCollector();
        TeiidComponentException failOnDefaultException = null;
View Full Code Here

  private void helpTestSelect(List elements, Criteria criteria, List childElements,
      ProcessorDataManager dataMgr, List[] expected,
      RelationalNode child,
      SelectNode selectNode) throws TeiidComponentException,
      TeiidProcessingException {
    BufferManager mgr = BufferManagerFactory.getStandaloneBufferManager();
        CommandContext context = new CommandContext("pid", "test", null, null, 1);               //$NON-NLS-1$ //$NON-NLS-2$
       
        child.setElements(childElements);
        child.initialize(context, mgr, dataMgr);
    selectNode.setCriteria(criteria);
View Full Code Here

TOP

Related Classes of org.teiid.common.buffer.BufferManager

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.