Package com.foundationdb.qp.operator

Examples of com.foundationdb.qp.operator.SimpleQueryContext


        }
    }

    private void updateIndex(Session session, FullTextIndexInfo indexInfo, Iterable<byte[]> rows) throws IOException {
        StoreAdapter adapter = store.createAdapter(session, indexInfo.getSchema());
        QueryContext queryContext = new SimpleQueryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();

        Cursor cursor = null;
        IndexWriter writer = indexInfo.getIndexer().getWriter();
        try(RowIndexer rowIndexer = new RowIndexer(indexInfo, writer, true)) {
            Operator operator = indexInfo.getOperator();
View Full Code Here


                                                 Table table,
                                                 RowData rowData)
    {
        Operator plan = PlanGenerator.generateBranchPlan(table.getAIS(), table);
        StoreAdapter adapter = createAdapter(session, SchemaCache.globalSchema(table.getAIS()));
        QueryContext queryContext = new SimpleQueryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();
        Cursor cursor = API.cursor(plan, queryContext, queryBindings);

        List<Column> lookupCols = table.getPrimaryKeyIncludingInternal().getColumns();
        RowDataValueSource pSource = new RowDataValueSource();
        for(int i = 0; i < lookupCols.size(); ++i) {
View Full Code Here

            this.session = session;
            AkibanInformationSchema ais = getAIS(session);
            Table changesTable = ais.getTable(CHANGES_TABLE);
            Operator plan = API.groupScan_Default(changesTable.getGroup());
            StoreAdapter adapter = store.createAdapter(session, SchemaCache.globalSchema(ais));
            QueryContext context = new SimpleQueryContext(adapter);
            this.cursor = API.cursor(plan, context, context.createBindings());
            cursor.open();
            findNextIndex();
        }
View Full Code Here

    /** Get a {@link QueryContext} for evaluations performed during
     * compilation, issuing warnings, etc.
     */
    public QueryContext getQueryContext() {
        return new SimpleQueryContext(null);
    }
View Full Code Here

    }

    private void scanAndCheckIndex(IndexRowType type, Row... expectedRows) {
        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = new SimpleQueryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();
        compareRows(
                expectedRows,
                API.cursor(
                        API.indexScan_Default(type, false, IndexKeyRange.unbounded(type)),
                        queryContext, queryBindings
View Full Code Here

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        IndexRowType indexRowType = schema.indexRowType(index);

        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = new SimpleQueryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();
        compareRows(
                new Row[] {
                        testRow(indexRowType, "a", 110, 1, 10, 100),
                        testRow(indexRowType, "a", 111, 1, 10, 101),
                        testRow(indexRowType, "a", 122, 1, 11, 111),
View Full Code Here

        for (int i = 0; i < expected.length; i++) {
            rows[i] = new TestRow(rowType, expected[i]);
        }
       
        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = new SimpleQueryContext(adapter);
       
        List<TableRowType> keepTypes = Arrays.asList(rowType);
       
        compareRows (
                rows,
                API.cursor(API.filter_Default(API.groupScan_Default(table.getGroup()),
                            keepTypes),
                        queryContext,
                        queryContext.createBindings())
            );
    }
View Full Code Here

        Row[] rows = new Row[expected.length];
        for(int i = 0; i < expected.length; ++i) {
            rows[i] = new TestRow(rowType, expected[i]);
        }
        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = new SimpleQueryContext(adapter);
        compareRows(
            rows,
            API.cursor(
                API.indexScan_Default(rowType, false, IndexKeyRange.unbounded(rowType)),
                queryContext,
                queryContext.createBindings()
            )
        );
    }
View Full Code Here

    private final StoreAdapter adapter;
    private final QueryContext delegate;

    public DelegatingContext(StoreAdapter adapter, QueryContext delegate) {
        this.adapter = adapter;
        this.delegate = (delegate == null) ? new SimpleQueryContext(adapter) : delegate;
    }
View Full Code Here

    }

    protected void runOperatorPlan(Plan plan, Session session,
                                   RowData oldRow, RowData newRow) {
        QueryContext context =
            new SimpleQueryContext(store.createAdapter(session, plan.schema),
                                   serviceManager);
        QueryBindings bindings = context.createBindings();
        if (plan.bindOldRow) {
            RowDataValueSource source = new RowDataValueSource();
            for (int i = 0; i < plan.ncols; i++) {
                source.bind(plan.referencedFields[i], oldRow);
                bindings.setValue(i, source);
View Full Code Here

TOP

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

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.