Package com.foundationdb.qp.operator

Examples of com.foundationdb.qp.operator.Operator


                      int fillerColumn,
                      int runs,
                      int rows,
                      boolean report)
    {
        Operator setup =
            project_DefaultTest(
                limit_Default(
                    groupScan_Default(group),
                    rows),
                tRowType,
                Arrays.asList(ExpressionGenerators.field(tRowType, 0),
                              ExpressionGenerators.field(tRowType, 1),
                              ExpressionGenerators.field(tRowType, 2),
                              ExpressionGenerators.field(tRowType, 3),
                              ExpressionGenerators.field(tRowType, fillerColumn)));
        RowType inputRowType = setup.rowType();
        int sortComplexity = 0;
        Ordering ordering = ordering();
        for (int f = 0; f < sortFields; f++) {
            boolean ascending = (orderingMask & (1 << f)) != 0;
            ordering.append(ExpressionGenerators.field(inputRowType, f), ascending);
            boolean previousAscending = (orderingMask & (1 << (f - 1))) != 0;
            if (f > 0 && ascending != previousAscending) {
                sortComplexity++;
            }
        }
        Operator sort =
            sort_General(
                setup,
                inputRowType,
                ordering,
                SortOption.PRESERVE_DUPLICATES);
View Full Code Here


    private void runOneMany(int runs, int childCount, boolean report)
    {
        IndexBound rid = new IndexBound(row(rootPKIndexType, childCount), new SetColumnSelector(0));
        IndexKeyRange rootRidRange = IndexKeyRange.bounded(rootPKIndexType, rid, true, rid, true);
        Operator outerPlan =
            flatten_HKeyOrdered(
                branchLookup_Default(
                    ancestorLookup_Default(
                        indexScan_Default(rootPKIndexType, false, rootRidRange),
                        group,
                        rootPKIndexType,
                        Collections.singleton(rootRowType),
                        InputPreservationOption.DISCARD_INPUT),
                    group,
                    rootRowType,
                    oneRowType,
                    InputPreservationOption.KEEP_INPUT),
                rootRowType,
                oneRowType,
                JoinType.INNER_JOIN);
        Operator innerPlan =
            flatten_HKeyOrdered(
                branchLookup_Nested(
                    group,
                    rootRowType,
                    rootRowType,
                    manyRowType,
                    InputPreservationOption.KEEP_INPUT,
                    0),
                rootRowType,
                manyRowType,
                JoinType.INNER_JOIN);
        TimeOperator timedOuter = new TimeOperator(outerPlan);
        TimeOperator timedInner = new TimeOperator(innerPlan);
        Operator plan =
            product_NestedLoops(
                timedOuter,
                timedInner,
                outerPlan.rowType(),
                rootRowType,
View Full Code Here

    private void runManyOne(int runs, int childCount, boolean report)
    {
        IndexBound rid = new IndexBound(row(rootPKIndexType, childCount), new SetColumnSelector(0));
        IndexKeyRange rootRidRange = IndexKeyRange.bounded(rootPKIndexType, rid, true, rid, true);
        Operator outerPlan =
            flatten_HKeyOrdered(
                branchLookup_Default(
                    ancestorLookup_Default(
                        indexScan_Default(rootPKIndexType, false, rootRidRange),
                        group,
                        rootPKIndexType,
                        Collections.singleton(rootRowType),
                        InputPreservationOption.DISCARD_INPUT),
                    group,
                    rootRowType,
                    manyRowType,
                    InputPreservationOption.KEEP_INPUT),
                rootRowType,
                manyRowType,
                JoinType.INNER_JOIN);
        Operator innerPlan =
            flatten_HKeyOrdered(
                branchLookup_Nested(
                    group,
                    rootRowType,
                    rootRowType,
                    oneRowType,
                    InputPreservationOption.KEEP_INPUT,
                    0),
                rootRowType,
                oneRowType,
                JoinType.INNER_JOIN);
        TimeOperator timedOuter = new TimeOperator(outerPlan);
        TimeOperator timedInner = new TimeOperator(innerPlan);
        Operator plan =
            product_NestedLoops(
                timedOuter,
                timedInner,
                outerPlan.rowType(),
                rootRowType,
View Full Code Here

        IndexBound hi = new IndexBound(row(idxRowType, indexedColumn.valueFor(Integer.MAX_VALUE)),
                                       new SetColumnSelector(0));
        Ordering ordering = new Ordering();
        ordering.append(field(idxRowType, 0), true);
        IndexKeyRange keyRange = IndexKeyRange.bounded(idxRowType, lo, true, hi, true);
        Operator plan = indexScan_Default(idxRowType, keyRange, ordering);
        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++) {
View Full Code Here

        queryBindings.setRow(0, boundRow);
        IndexBound bound = new IndexBound(boundRow, new SetColumnSelector(0));
        IndexKeyRange keyRange = IndexKeyRange.bounded(idxRowType, bound, true, bound, true);
        Ordering ordering = new Ordering();
        ordering.append(field(idxRowType, 0), true);
        Operator plan = indexScan_Default(idxRowType, keyRange, ordering);
        Cursor cursor = cursor(plan, queryContext, queryBindings);
        long startTime = System.nanoTime();
        for (int r = 0; r < runs; r++) {
            for (int s = 0; s < sequentialAccessesPerRandom; s++) {
                Object key = keys[s];
View Full Code Here

    }
   
    private KeyReadCursor getKeyCursor (RowType rowType, List<BindableRow> rows) {

        Operator op = valuesScan_Default(rows, rowType);
        Cursor cursor = cursor(op, queryContext, queryBindings);
        API.Ordering ordering = API.ordering();
        ordering.append(new TPreparedField (rowType.typeAt(0), 0), true);
       
        MergeJoinSorter mergeSorter = new MergeJoinSorter(queryContext, queryBindings, cursor,
View Full Code Here

        }
    }

    private void run(int runs, boolean report)
    {
        Operator scan = groupScan_Default(group);
        TimeOperator timeScan = new TimeOperator(scan);
        Operator select = select_HKeyOrdered(timeScan, tRowType, ExpressionGenerators.literal(Boolean.TRUE));
        long start = System.nanoTime();
        for (int r = 0; r < runs; r++) {
            Cursor cursor = cursor(select, queryContext, queryBindings);
            cursor.openTopLevel();
            while (cursor.next() != null);
View Full Code Here

    protected List<Row> runPlanTxn(final OperatorCreator creator) {
        return txnService().run(session(), new Callable<List<Row>>() {
            @Override
            public List<Row> call() throws Exception {
                Schema schema = SchemaCache.globalSchema(ais());
                Operator plan = creator.create(schema);
                StoreAdapter adapter = store().createAdapter(session(), schema);
                QueryContext context = new SimpleQueryContext(adapter, serviceManager());
                QueryBindings bindings = context.createBindings();
                List<Row> rows = new ArrayList<>();
                Cursor cursor = API.cursor(plan, context, bindings);
View Full Code Here

        return new RuntimeException("unexpected exception", cause);
    }

    protected List<Row> scanAll(int tableID) {
        Table table = getTable(tableID);
        Operator plan = scanTablePlan(table);
        return runPlan(session(), SchemaCache.globalSchema(table.getAIS()), plan);
    }
View Full Code Here

            }
        }
        if(index == null) {
            throw new IllegalArgumentException("no indexid: " + indexID);
        }
        Operator plan = scanIndexPlan(index);
        return runPlan(session(), SchemaCache.globalSchema(table.getAIS()), plan);
    }
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.