Examples of QueryBindings


Examples of com.foundationdb.qp.operator.QueryBindings

        final AkibanInformationSchema newAIS = schemaManager.getOnlineAIS(session);

        final Schema origSchema = SchemaCache.globalSchema(origAIS);
        final StoreAdapter origAdapter = store.createAdapter(session, origSchema);
        final QueryContext origContext = new DelegatingContext(origAdapter, context);
        final QueryBindings origBindings = origContext.createBindings();

        final TransformCache transformCache = getTransformCache(session, null);
        Set<Table> origRoots = findOldRoots(changeSets, origAIS, newAIS);

        for(Table root : origRoots) {
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

            case TABLE:
                if(transform.deleteOperator != null && transform.insertOperator != null) {
                    Schema schema = transform.rowType.schema();
                    StoreAdapter adapter = store.createAdapter(session, schema);
                    context = new SimpleQueryContext(adapter);
                    QueryBindings bindings = context.createBindings();
                    if (doDelete) {
                        Row origOldRow = new RowDataRow(transform.rowType, oldRowData);
                        bindings.setRow(OperatorAssembler.CREATE_AS_BINDING_POSITION, origOldRow);
                        try {
                            runPlan(context, transform.deleteOperator, bindings);
                        } catch (NoSuchRowException e) {
                            LOG.debug("row not present: {}", origOldRow);
                        }
                    }
                    if (doWrite) {
                        Row origOldRow = new RowDataRow(transform.rowType, newRowData);
                        bindings.setRow(OperatorAssembler.CREATE_AS_BINDING_POSITION, origOldRow);
                        try {
                            runPlan(context, transform.insertOperator, bindings);
                        } catch (NoSuchRowException e) {
                            LOG.debug("row not present: {}", origOldRow);
                        }
                    }
                    break;
                }
            case GROUP:
                Schema schema = transform.rowType.schema();
                StoreAdapter adapter = store.createAdapter(session, schema);
                context = new SimpleQueryContext(adapter);
                QueryBindings bindings = context.createBindings();
                if(doDelete) {
                    Row origOldRow = new RowDataRow(transform.rowType, oldRowData);
                    Row newOldRow = transformRow(context, bindings, transform, origOldRow);
                    try {
                        adapter.deleteRow(newOldRow, false);
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

                                TransactionService txnService,
                                Operator plan,
                                RowHandler handler) {
        LOG.debug("Running online plan: {}", plan);
        Map<RowType,HKeyChecker> checkers = new HashMap<>();
        QueryBindings bindings = context.createBindings();
        Cursor cursor = API.cursor(plan, context, bindings);
        Rebindable rebindable = getRebindable(cursor);
        cursor.openTopLevel();
        try {
            boolean done = false;
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

                @Override
                public String getCurrentSchema() {
                    return SCHEMA_NAME;
                }
            };
        QueryBindings queryBindings = queryContext.createBindings();
        queryBindings.setValue(0, new Value(MString.varcharFor(SCHEMA_NAME), SCHEMA_NAME));
        queryBindings.setValue(1, new Value(MString.varcharFor(groupName), groupName));
        if (multiple)
            queryBindings.setValue(2, new Value(MNumeric.INT.instance(false), 10));
        if (commitFreq > 0)
            queryBindings.setValue(3, new Value(MNumeric.INT.instance(false), commitFreq));

        DirectObjectCursor cursor = plan.cursor(queryContext, queryBindings);
       
        StringBuilder actual = new StringBuilder();
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

        DirectObjectPlan plan = loadablePlan.plan();

        Schema schema = new Schema(ais());
        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = queryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();

        DirectObjectCursor cursor = plan.cursor(queryContext, queryBindings);
        queryBindings.setValue(0, new Value(MString.varcharFor("stat"), "stat"));
        queryBindings.setValue(1, new Value(MString.varcharFor("count=3"), "count=3"));
        queryBindings.setValue(2, new Value(MString.varcharFor("delay=2"), "delay=2"));
        queryBindings.setValue(3, new Value(MString.varcharFor("-a"), "-a"));
       
        int populatedResults = 0;
        int emptyResults = 0;
       
        cursor.open();
View Full Code Here

Examples of com.foundationdb.qp.operator.QueryBindings

        try {
            Operator planOperator = rootOperator();
            if (planOperator == null)
                return;
            QueryContext context = new SimpleQueryContext(adapter);
            QueryBindings bindings = context.createBindings();
            List<Column> lookupCols = rowType.table().getPrimaryKeyIncludingInternal().getColumns();

            bindings.setHKey(StoreGIMaintenance.HKEY_BINDING_POSITION, hKey);

            // Copy the values into the array bindings
            RowDataValueSource pSource = new RowDataValueSource();
            for (int i=0; i < lookupCols.size(); ++i) {
                int bindingsIndex = i+1;
                Column col = lookupCols.get(i);
                pSource.bind(col.getFieldDef(), forRow);
                bindings.setValue(bindingsIndex, pSource);
            }
            cursor = API.cursor(planOperator, context, bindings);
            RUN_TAP.in();
            runTapEntered = true;
            cursor.openTopLevel();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.