Package org.modeshape.jcr.query.engine

Examples of org.modeshape.jcr.query.engine.IndexPlan


        for (PlanNode source : plan.findAllAtOrBelow(Type.SOURCE)) {
            source.orderChildren(Type.INDEX, new Comparator<PlanNode>() {
                @Override
                public int compare( PlanNode o1,
                                    PlanNode o2 ) {
                    IndexPlan index1 = o1.getProperty(Property.INDEX_SPECIFICATION, IndexPlan.class);
                    IndexPlan index2 = o2.getProperty(Property.INDEX_SPECIFICATION, IndexPlan.class);
                    assert index1 != null;
                    assert index2 != null;
                    return index1.compareTo(index2);
                }
            });
View Full Code Here


                                          String workspaceName,
                                          String providerName,
                                          Collection<JoinCondition> joinConditions,
                                          int costEstimate,
                                          long cardinalityEstimate ) {
                        IndexPlan indexPlan = new IndexPlan(name, workspaceName, providerName, null, joinConditions,
                                                            costEstimate, cardinalityEstimate, 1.0f, null);
                        indexPlans.add(indexPlan);
                    }

                    @Override
                    public void addIndex( String name,
                                          String workspaceName,
                                          String providerName,
                                          Collection<Constraint> constraints,
                                          int costEstimate,
                                          long cardinalityEstimate,
                                          Float selectivityEstimate,
                                          Map<String, Object> parameters ) {
                        // Add a plan node for this index ...
                        IndexPlan indexPlan = new IndexPlan(name, workspaceName, providerName, constraints, null, costEstimate,
                                                            cardinalityEstimate, selectivityEstimate, parameters);
                        indexPlans.add(indexPlan);
                    }

                    @Override
View Full Code Here

                            str.append(item);
                        }
                    }
                    str.append(']');
                } else if (value instanceof IndexPlan) {
                    IndexPlan index = (IndexPlan)value;
                    str.append(index.getName());
                    // if (index.getWorkspaceName() != null) {
                    // str.append(", workspace=").append(index.getWorkspaceName());
                    // } else {
                    // str.append(", workspace=*");
                    // }
                    if (index.getProviderName() != null) {
                        str.append(", provider=").append(index.getProviderName());
                    } else {
                        str.append(", provider=<implicit>");
                    }
                    str.append(", cost~=").append(index.getCostEstimate());
                    str.append(", cardinality~=").append(index.getCardinalityEstimate());
                    Float selectivity = index.getSelectivityEstimate();
                    if (selectivity != null) {
                        str.append(", selectivity~=").append(selectivity.floatValue());
                    } else {
                        str.append(", selectivity~=?");
                    }
                    if (!index.getConstraints().isEmpty()) {
                        str.append(", constraints=").append(index.getConstraints());
                    }
                    for (Map.Entry<String, Object> param : index.getParameters().entrySet()) {
                        str.append(", ").append(param.getKey()).append('=').append(param.getValue());
                    }
                } else {
                    str.append(value);
                }
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.query.engine.IndexPlan

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.