Package com.foundationdb.qp.operator

Examples of com.foundationdb.qp.operator.Operator


    }

    protected final List<Row> scanAllIndex(Index index) {
        AkibanInformationSchema ais = ais();
        Schema schema = SchemaCache.globalSchema(ais);
        Operator plan = API.indexScan_Default(schema.indexRowType(index));
        return runPlan(session(), schema, plan);
    }
View Full Code Here


    protected List<Row> updateRow(Session session, final Row oldRow, final Row newRow) {
        if(oldRow.rowType() != newRow.rowType()) {
            throw new IllegalArgumentException("mixed RowTypes");
        }
        Operator plan = API.update_Returning(API.valuesScan_Default(bindableRows(oldRow), oldRow.rowType()),
                                             new UpdateFunction()
                                             {
                                                 @Override
                                                 public Row evaluate(Row original,
                                                                     QueryContext context,
View Full Code Here

    protected List<Row> deleteRow(Row row) {
        return deleteRow(row, false);
    }

    protected List<Row> deleteRow(Row row, boolean cascade) {
        Operator plan = API.delete_Returning(API.valuesScan_Default(bindableRows(row),
                                                                    row.rowType()),
                                             cascade);
        return runPlan(session(), row.rowType().schema(), plan);
    }
View Full Code Here

    protected void expectRowsSkipInternal(int tableID, Row... expectedRows) {
        expectRows(tableID, true, Arrays.asList(expectedRows));
    }

    protected void expectRows(int tableID, boolean skipInternal, Collection<Row> expectedRows) {
        Operator plan = scanTablePlan(getTable(tableID));
        expectRows(plan, skipInternal, expectedRows);
        expectRowCount(tableID, expectedRows.size());
    }
View Full Code Here

        final int CUSTOMERS = 1000;
        final int ORDERS_PER_CUSTOMER = 5;
        final int ITEMS_PER_ORDER = 2;
        populateDB(CUSTOMERS, ORDERS_PER_CUSTOMER, ITEMS_PER_ORDER);
        long start = System.nanoTime();
        Operator plan = groupScan_Default(coi);
        for (int s = 0; s < SCANS; s++) {
            Cursor cursor = cursor(plan, queryContext, queryBindings);
            cursor.openTopLevel();
            while (cursor.next() != null) {
            }
View Full Code Here

    }

    // TODO: Can narrow synchronization to plans and schema.

    public synchronized Operator generateScanPlan(Table table) {
        Operator plan = scanPlans.get(table);
        if (plan != null) return plan;

        plan =  com.foundationdb.sql.optimizer.rule.PlanGenerator.generateScanPlan(schema.ais(), table);
       
        scanPlans.put(table, plan);
View Full Code Here

        scanPlans.put(table, plan);
        return plan;
    }

    public synchronized Operator generateBranchPlan(Table table) {
        Operator plan = branchPlans.get(table);
        if (plan != null) return plan;
       
        plan =  com.foundationdb.sql.optimizer.rule.PlanGenerator.generateBranchPlan(schema.ais(), table);

        branchPlans.put(table, plan);
View Full Code Here

        // No caching possible.
        return com.foundationdb.sql.optimizer.rule.PlanGenerator.generateBranchPlan(table, scan, scanType);
    }
   
    public Operator generateAncestorPlan (Table table) {
        Operator plan = ancestorPlans.get(table);
        if (plan != null) return plan;
       
        plan = com.foundationdb.sql.optimizer.rule.PlanGenerator.generateAncestorPlan(schema.ais(), table);
        ancestorPlans.put(table, plan);
        return plan;
View Full Code Here

        } else {
            filterTypes = Collections.singleton(schema.tableRowType(table));
        }

        // We can't do a "fast truncate" for whatever reason so do so with a full scan.
        Operator plan =
            API.delete_Returning(
                API.filter_Default(
                    API.groupScan_Default(table.getGroup()), filterTypes),
                false
            );
View Full Code Here

                        long targetId2,
                        IndexKeyRange range,
                        API.Ordering ordering,         
                        long expected[][])
    {
        Operator plan = indexScan_Default(idxRowType, range, ordering);
        Cursor cursor = cursor(plan, queryContext, queryBindings);
        cursor.openTopLevel();


        cursor.jump(indexRowWithId(targetId1, targetId2), INDEX_ROW_SELECTOR);
View Full Code Here

TOP

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

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.