Package com.foundationdb.qp.operator

Examples of com.foundationdb.qp.operator.RowCursor


                row(rowType, 1L),
        };
       
        bindRows.add(BindableRow.of(rows[0]));
   
        RowCursor cursor = cycleRows(rowType);
        compareRows(rows, cursor);
    }
View Full Code Here


        Row[] rows = new Row[] {
                row(rowType, 1L, 100L, "A"),
        };
       
        bindRows.add(BindableRow.of(rows[0]));
        RowCursor cursor = cycleRows (rowType);
        compareRows(rows, cursor);
    }
View Full Code Here

        for (long i = 0; i < 100; i++) {
            Row row = row (rowType, i);
            rows.add(row);
            bindRows.add(BindableRow.of(row));
        }
        RowCursor cursor = cycleRows (rowType);
       
        Row[] rowArray = new Row[rows.size()];
        compareRows (rows.toArray(rowArray), cursor);
    }
View Full Code Here

            Row row = row (rowType, random.nextInt(), i,
                    characters(5+random.nextInt(1000)));
            rows.add(row);
            bindRows.add(BindableRow.of(row));
        }
        RowCursor cursor = cycleRows(rowType);
        Row[] rowArray = new Row[rows.size()];
        compareRows (rows.toArray(rowArray), cursor);
       
    }
View Full Code Here

            BigDecimal value = new BigDecimal (random.nextInt(100000));
            rows.add(row(rowType, random.nextInt(), value, characters(5+random.nextInt(10))));
            bindRows.add(BindableRow.of(rows.get(i)));
        }
       
        RowCursor cursor = cycleRows(rowType);
        Row[] rowArray = new Row[rows.size()];
        compareRows (rows.toArray(rowArray), cursor);
    }
View Full Code Here

        List<Row> rows = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            rows.add(row(rowType, characters(5+random.nextInt(100)), characters(5+random.nextInt(10))));
            bindRows.add(BindableRow.of(rows.get(i)));
        }
        RowCursor cursor = cycleRows(rowType);
        Row[] rowArray = new Row[rows.size()];
        compareRows (rows.toArray(rowArray), cursor);
    }
View Full Code Here

    }

    @Test
    public void testNoCursors()
    {
        RowCursor multiCursor = multiCursor();
        multiCursor.open();
        assertTrue(multiCursor.isIdle());
        assertNull(multiCursor.next());
    }
View Full Code Here

        for (int n = 0; n < 10; n++) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = i;
            }
            RowCursor multiCursor = multiCursor(new TestCursor(a));
            multiCursor.open();
            assertTrue(multiCursor.isActive());
            Row row;
            long expected = 0;
            while ((row = multiCursor.next()) != null) {
                assertEquals(expected, unwrap(row));
                expected++;
            }
            assertEquals(n, expected);
            assertTrue(multiCursor.isIdle());
        }
    }
View Full Code Here

    {
        testMultipleCursors(true);
    }

    private void testMultipleCursors(boolean openAll) {
        RowCursor multiCursor = multiCursor(openAll,
                                            new TestCursor(new int[]{}),
                                            new TestCursor(new int[]{0, 1, 2}),
                                            new TestCursor(new int[]{}),
                                            new TestCursor(new int[]{}),
                                            new TestCursor(new int[]{3}),
                                            new TestCursor(new int[]{}),
                                            new TestCursor(new int[]{}));
        multiCursor.open();
        Row row;
        long expected = 0;
        while ((row = multiCursor.next()) != null) {
            assertEquals(expected, unwrap(row));
            expected++;
        }
        assertEquals(4, expected);
        assertTrue(multiCursor.isIdle());
    }
View Full Code Here

        for(int i = 0; i < fieldOrdering.length; ++i) {
            ordering.append(field(inputOperator.rowType(), i), fieldOrdering[i]);
        }

        Sorter sorter = createSorter(context, bindings, inputCursor, inputOperator.rowType(), ordering, sortOption, TEST_TAP);
        RowCursor sortedCursor = sorter.sort();

        Row[] expectedRows = createBuilder(expected).rows().toArray(new Row[expected.size()]);
        compareRows(expectedRows, sortedCursor);
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.qp.operator.RowCursor

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.