Package com.foundationdb.qp.row

Examples of com.foundationdb.qp.row.Row


                QueryContext context = new SimpleQueryContext(adapter);
                QueryBindings bindings = context.createBindings();
                Cursor cursor = API.cursor(plan, context, bindings);
                cursor.openTopLevel();
                try {
                    Row row;
                    while((row = cursor.next()) != null) {
                        getScannedRows().add(row);
                        switch(getScannedRows().size()) {
                            case 1: to(Stage.SCAN_FIRST_ROW); break;
                            case 2: to(Stage.SCAN_SECOND_ROW); break;
View Full Code Here


    }

    private void populateDB()
    {
        // First column determines match
        Row row;
        for (int i = 0; i < ROWS; i++) {
            row = row(t, FIRST_KEY_COLUMN_UNIQUE, // index_key
                      i, // c1
                      FIRST_KEY_COLUMN_UNIQUE, //c2
                      FIRST_KEY_COLUMN_UNIQUE, //c3
View Full Code Here

    private void dump(Operator plan)
    {
        Cursor cursor = cursor(plan, queryContext, queryBindings);
        cursor.openTopLevel();
        Row row;
        while ((row = cursor.next()) != null) {
            System.out.println(row);
        }
    }
View Full Code Here

        long start = System.nanoTime();
        for (int r = 0; r < runs; r++) {
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            for (int s = 0; s < sequentialAccessesPerRandom; s++) {
                Row row = cursor.next();
                assert row != null;
            }
            cursor.close();
        }
        long end = System.nanoTime();
View Full Code Here

                    valueHolder.putInt64((long) ((Integer) key).intValue());
                } else {
                    valueHolder.putString((String) key, null);
                }
                cursor.openTopLevel();
                Row row = cursor.next();
                assert row != null;
                cursor.closeTopLevel();
            }
        }
        long endTime = System.nanoTime();
View Full Code Here

    public void cycleNRows() throws IOException {
        RowType rowType = schema.newValuesType(MNumeric.INT.instance(true));
       
        List<Row> rows = new ArrayList<>();
        for (long i = 0; i < 100; i++) {
            Row row = row (rowType, i);
            rows.add(row);
            bindRows.add(BindableRow.of(row));
        }
        RowCursor cursor = cycleRows (rowType);
       
View Full Code Here

    @Test
    public void cycleManyRows() throws IOException {
        RowType rowType = schema.newValuesType(MNumeric.INT.instance(false), MNumeric.INT.instance(true), MString.varchar());
        List<Row> rows = new ArrayList<>();
        for (long i = 0; i < 100; i++) {
            Row row = row (rowType, random.nextInt(), i,
                    characters(5+random.nextInt(1000)));
            rows.add(row);
            bindRows.add(BindableRow.of(row));
        }
        RowCursor cursor = cycleRows(rowType);
View Full Code Here

                if (CURSOR_LIFECYCLE_ENABLED) {
                    CursorLifecycle.checkIdleOrActive(this);
                }
                checkQueryCancelation();
               
                Row inputRow;
                if ((inputRow = input.next()) != null) {
                    adapter().deleteRow(inputRow, cascadeDelete);
                    if (LOG_EXECUTION) {
                        LOG.debug("Delete_Returning: deleting {}", inputRow);
                    }
View Full Code Here

            super(context, input);
        }

        @Override
        public Row next() {
            Row inputRow = input.next();
            if(inputRow != null) {
                ValuesHolderRow counterRow = new ValuesHolderRow(bufferRowType.first());
                counterRow.valueAt(0).putInt64(counter++);
                inputRow = new CompoundRow(bufferRowType, counterRow, inputRow);
            }
View Full Code Here

            }
            try {
                if (CURSOR_LIFECYCLE_ENABLED) {
                    CursorLifecycle.checkIdleOrActive(this);
                }
                Row next = sorter.next();
                if(next != null) {
                    assert next.rowType() == bufferRowType;
                    // Common case coming out of default Sorters
                    if(next instanceof ValuesHolderRow) {
                        ValuesHolderRow valuesRow = (ValuesHolderRow)next;
                        RowType realRowType = bufferRowType.second();
                        List<Value> values = valuesRow.values();
                        next = new ValuesHolderRow(realRowType, values.subList(1, realRowType.nFields() + 1));
                    } else if(next instanceof CompoundRow) {
                        next = ((CompoundRow)next).subRow(bufferRowType.second());
                    } else {
                        throw new IllegalStateException("Unexpected Row: " + next.getClass());
                    }
                }
                return next;
            } finally {
                if (TAP_NEXT_ENABLED) {
View Full Code Here

TOP

Related Classes of com.foundationdb.qp.row.Row

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.