Package java.util

Examples of java.util.List


        assertEquals(1, region.getJoinSourceNodes().size());
    }

    public void testReconstruction() {
       
        List regions = new ArrayList();
       
        PlanNode joinRoot = TestFrameUtil.getExamplePlan();
       
        PlanNode source = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
       
        source.addFirstChild(joinRoot);
       
        RulePlanJoins.findJoinRegions(source, null, regions);
       
        assertEquals(1, regions.size());
       
        JoinRegion region = (JoinRegion)regions.get(0);
       
        assertEquals(3, region.getJoinSourceNodes().size());
       
        assertEquals(joinRoot, region.getJoinRoot());
       
View Full Code Here


   
    private FakeRelationalNode createFakeNode(List[] data) {
        // setup
        ElementSymbol element = new ElementSymbol("a"); //$NON-NLS-1$
        element.setType(DataTypeManager.DefaultDataClasses.INTEGER);
        List elements = new ArrayList();
        elements.add(element);
       
        FakeRelationalNode fakeNode = new FakeRelationalNode(1, data, 100);
        fakeNode.setElements(elements);
        CommandContext context = new CommandContext("pid", "group", null, null, null, 1, null, true); //$NON-NLS-1$ //$NON-NLS-2$
        fakeNode.initialize(context, BufferManagerFactory.getStandaloneBufferManager(), null);
View Full Code Here

        int currentRow = 1;
        while(true) {
            try {
                TupleBatch batch = union.nextBatch();
                for(int row = currentRow; row <= batch.getEndRow(); row++) {
                    List tuple = batch.getTuple(row);
                    //System.out.println(tuple);
                    assertEquals("Rows don't match at " + row, expected[row-1], tuple); //$NON-NLS-1$
                }
               
                currentRow += batch.getRowCount();   
View Full Code Here

        es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);

        ElementSymbol es2 = new ElementSymbol("e2"); //$NON-NLS-1$
        es2.setType(DataTypeManager.DefaultDataClasses.INTEGER);

        List leftElements = new ArrayList();
        leftElements.add(es1);
        RelationalNode leftNode = new FakeRelationalNode(1, new List[0]);
        leftNode.setElements(leftElements);

        List rightElements = new ArrayList();
        rightElements.add(es2);
        RelationalNode rightNode = new FakeRelationalNode(2, new List[0]);
        rightNode.setElements(rightElements);
       
        List unionElements = new ArrayList();
        unionElements.add(es1);

        UnionAllNode union = new UnionAllNode(3);
        union.setElements(unionElements);
       
        helpTestUnion(new RelationalNode[] {leftNode, rightNode}, union, new List[0]);       
View Full Code Here

        ElementSymbol es2 = new ElementSymbol("e2"); //$NON-NLS-1$
        es2.setType(DataTypeManager.DefaultDataClasses.INTEGER);

        RelationalNode[] nodes = new RelationalNode[sources];
        for(int i=0; i<nodes.length; i++) {
            List childElements = new ArrayList();
            childElements.add(es1);
           
            // Build source data
            List[] tuples = new List[rowsPerSource];
            for(int r = 0; r<rowsPerSource; r++) {
                tuples[r] = Arrays.asList(new Object[] { new Integer(i) });
            }
           
            if(blockModIndex >= 0 && (i % blockModIndex == 0)) {
                nodes[i] = new BlockingFakeRelationalNode(i, tuples, batchSize);
            } else {               
                nodes[i] = new FakeRelationalNode(i, tuples, batchSize);
            }
            nodes[i].setElements(childElements);          
        }
       
        List unionElements = new ArrayList();
        unionElements.add(es1);

        UnionAllNode union = new UnionAllNode(nodes.length);
        union.setElements(unionElements);
       
        helpTestUnion(nodes, union, expected);          
View Full Code Here

       
        helpTestUnion(nodes, union, expected);          
    }
   
    @Test public void testBasicUnion() throws TeiidComponentException, TeiidProcessingException {
        List expected[] = new List[] {
            Arrays.asList(new Object[] { new Integer(0) }),   
            Arrays.asList(new Object[] { new Integer(0) }),   
            Arrays.asList(new Object[] { new Integer(1) }),
            Arrays.asList(new Object[] { new Integer(1) })
         
View Full Code Here

        helpTestUnionConfigs(2, -1, 2, 50, expected);
       
    }

    @Test public void testBasicUnionMultipleSources() throws TeiidComponentException, TeiidProcessingException {
        List expected[] = new List[] {
            Arrays.asList(new Object[] { new Integer(0) }),   
            Arrays.asList(new Object[] { new Integer(0) }),   
            Arrays.asList(new Object[] { new Integer(1) }),
            Arrays.asList(new Object[] { new Integer(1) }),   
            Arrays.asList(new Object[] { new Integer(2) }),   
View Full Code Here

        helpTestUnionConfigs(5, -1, 2, 50, expected);
    }

    @Test public void testMultipleSourcesHalfBlockingNodes() throws TeiidComponentException, TeiidProcessingException  {
        List expected[] = new List[] {
            Arrays.asList(new Object[] { new Integer(1) }),   
            Arrays.asList(new Object[] { new Integer(0) }),   
            Arrays.asList(new Object[] { new Integer(3) }),   
            Arrays.asList(new Object[] { new Integer(2) }),
            Arrays.asList(new Object[] { new Integer(4) })         
View Full Code Here

        helpTestUnionConfigs(5, 2, 1, 50, expected);
    }
   
    @Test public void testMultipleSourcesAllBlockingNodes() throws TeiidComponentException, TeiidProcessingException {
        List expected[] = new List[] {
            Arrays.asList(new Object[] { new Integer(0) }),   
            Arrays.asList(new Object[] { new Integer(1) }),   
            Arrays.asList(new Object[] { new Integer(2) }),   
            Arrays.asList(new Object[] { new Integer(3) }),
            Arrays.asList(new Object[] { new Integer(4) })         
View Full Code Here

        helpTestUnionConfigs(5, 1, 1, 50, expected);      
    }   
   
    @Test public void testMultipleSourceMultiBatchAllBlocking() throws TeiidComponentException, TeiidProcessingException {
        List expected[] = new List[] {
            Arrays.asList(new Object[] { new Integer(0) }),   
            Arrays.asList(new Object[] { new Integer(1) }),   
            Arrays.asList(new Object[] { new Integer(0) }),   
            Arrays.asList(new Object[] { new Integer(2) }),   
            Arrays.asList(new Object[] { new Integer(0) }),   
View Full Code Here

TOP

Related Classes of java.util.List

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.