Examples of OverlayingRow


Examples of com.foundationdb.qp.row.OverlayingRow

                           new UpdateFunction()
                           {
                               @Override
                               public Row evaluate(Row original, QueryContext context, QueryBindings bindings)
                               {
                                   OverlayingRow updatedRow = new OverlayingRow(original);
                                   long i = original.value(1).getInt64();
                                   updatedRow.overlay(1, i - 1000000);
                                   return updatedRow;
                               }

                               @Override
                               public boolean rowIsSelected(Row row)
View Full Code Here

Examples of com.foundationdb.qp.row.OverlayingRow

                           new UpdateFunction()
                           {
                               @Override
                               public Row evaluate(Row original, QueryContext context, QueryBindings bindings)
                               {
                                   OverlayingRow updatedRow = new OverlayingRow(original);
                                   long i = original.value(0).getInt64();
                                   updatedRow.overlay(0, i - 1000000);
                                   return updatedRow;
                               }

                               @Override
                               public boolean rowIsSelected(Row row)
                               {
                                   return true;
                               }
                           });
        final UpdatePlannable revertPlan =
            update_Default(scanPlan,
                           new UpdateFunction()
                           {
                               @Override
                               public Row evaluate(Row original, QueryContext context, QueryBindings bindings)
                               {
                                   OverlayingRow updatedRow = new OverlayingRow(original);
                                   long i = original.value(0).getInt64();
                                   updatedRow.overlay(0, i + 1000000);
                                   return updatedRow;
                               }

                               @Override
                               public boolean rowIsSelected(Row row)
View Full Code Here

Examples of com.foundationdb.qp.row.OverlayingRow

                           new UpdateFunction()
                           {
                               @Override
                               public Row evaluate(Row original, QueryContext context, QueryBindings bindings)
                               {
                                   OverlayingRow updatedRow = new OverlayingRow(original);
                                   long i = original.value(0).getInt64();
                                   updatedRow.overlay(0, i - 1000000);
                                   return updatedRow;
                               }

                               @Override
                               public boolean rowIsSelected(Row row)
View Full Code Here

Examples of com.foundationdb.qp.row.OverlayingRow

                throw new WrongRowTypeException(inputRow, currentInputRowType);
            }
            if (currentInputRowType == rowType()) {
                return inputRow;
            }
            OverlayingRow row = new OverlayingRow(inputRow, rowType());
            return row;
        }
View Full Code Here

Examples of com.foundationdb.qp.row.OverlayingRow

        private Row wrapped(Row inputRow) {
            assert inputRow != null;
            if (!useOverlayRow()) {
                return inputRow;
            }
            OverlayingRow row = new OverlayingRow(inputRow, rowType());
            return row;
        }
View Full Code Here

Examples of com.foundationdb.qp.row.OverlayingRow

                }
               
                if (next == null) {
                    return next;
                } else if (useOverlayRow()) {
                    return new OverlayingRow (next, rowType());
                } else {
                    return next;
                }
            } finally {
                if (TAP_NEXT_ENABLED) {
View Full Code Here

Examples of com.foundationdb.qp.row.OverlayingRow

        return row.rowType().equals(rowType);
    }

    @Override
    public Row evaluate(Row original, QueryContext context, QueryBindings bindings) {
        OverlayingRow result = new OverlayingRow(original);
        int nfields = rowType.nFields();
        for (int i = 0; i < nfields; i++) {
            TPreparedExpression expression = pExpressions.get(i);
            if (expression != null) {
                TEvaluatableExpression evaluation = expression.build();
                evaluation.with(original);
                evaluation.with(context);
                evaluation.with(bindings);
                evaluation.evaluate();
                result.overlay(i, evaluation.resultValue());
            }
        }
        return result;
    }
View Full Code Here

Examples of com.foundationdb.qp.row.OverlayingRow

    private void doTestJump(Cursor cursor, long idOrdering[], int nudge, List<List<Long>> expecteds)
    {
        for (int start = 0; start < idOrdering.length; ++start)
        {
            TestRow target = indexRow(idOrdering[start]);
            OverlayingRow nudgedTarget = new OverlayingRow(target);
            //TODO: Not use value.getInt32()
            nudgedTarget.overlay(3, (long)(target.value(3).getInt32() + nudge));
            cursor.jump(nudgedTarget, INDEX_ROW_SELECTOR);
            Row row;
            List<Long> actualIds = new ArrayList<>();
            while ((row = cursor.next()) != null) {
                actualIds.add((long)row.value(3).getInt32());
View Full Code Here

Examples of com.foundationdb.qp.row.OverlayingRow

        return row.rowType().equals(rowType);
    }

    @Override
    public Row evaluate(Row original, QueryContext context, QueryBindings bindings) {
        OverlayingRow result = new OverlayingRow(original);
        int nfields = rowType.nFields();
        for (int i = 0; i < nfields; i++) {
            TPreparedExpression expression = pExpressions.get(i);
            if (expression != null) {
                TEvaluatableExpression evaluation = expression.build();
                evaluation.with(original);
                evaluation.with(context);
                evaluation.with(bindings);
                evaluation.evaluate();
                result.overlay(i, evaluation.resultValue());
            }
        }
        return result;
    }
View Full Code Here

Examples of com.foundationdb.qp.row.OverlayingRow

    private void testJump(Cursor cursor, long[] idOrdering, int nudge)
    {
        for (int start = 0; start < idOrdering.length; start++) {
            TestRow target = indexRow(idOrdering[start]);
            // Add nudge to last field
            OverlayingRow nudgedTarget = new OverlayingRow(target);
            nudgedTarget.overlay(3, ((long)target.value(3).getInt32() + nudge));
            cursor.jump(nudgedTarget, INDEX_ROW_SELECTOR);
            Row row;
            List<Long> actualIds = new ArrayList<>();
            while ((row = cursor.next()) != null) {
                actualIds.add((long)row.value(3).getInt32());
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.