Examples of QueryOptimizer


Examples of org.apache.phoenix.optimize.QueryOptimizer

                hint = HintNode.create(hint, Hint.USE_DATA_OVER_INDEX_TABLE);
            }
            select = SelectStatement.create(select, hint);
            // Pass scan through if same table in upsert and select so that projection is computed correctly
            // Use optimizer to choose the best plan
            plan = new QueryOptimizer(services).optimize(statement, select, selectResolver, targetColumns, parallelIteratorFactory);
            runOnServer &= plan.getTableRef().equals(tableRef);
            rowProjectorToBe = plan.getProjector();
            nValuesToSet = rowProjectorToBe.getColumnCount();
            // Cannot auto commit if doing aggregation or topN or salted
            // Salted causes problems because the row may end up living on a different region
View Full Code Here

Examples of org.apache.phoenix.optimize.QueryOptimizer

        }
       
        RowProjector projectorToBe = null;
        // Optimize only after all checks have been performed
        if (valueNodes == null) {
            queryPlanToBe = new QueryOptimizer(services).optimize(queryPlanToBe, statement, targetColumns, parallelIteratorFactoryToBe);
            projectorToBe = queryPlanToBe.getProjector();
            runOnServer &= queryPlanToBe.getTableRef().equals(tableRefToBe);
        }
        final List<PColumn> allColumns = allColumnsToBe;
        final RowProjector projector = projectorToBe;
View Full Code Here

Examples of org.apache.phoenix.optimize.QueryOptimizer

                        Collections.<ParseNode>emptyList(), null,
                        delete.getOrderBy(), delete.getLimit(),
                        delete.getBindCount(), false, false);
                select = StatementNormalizer.normalize(select, resolver);
                parallelIteratorFactory = hasLimit ? null : new DeletingParallelIteratorFactory(connection, tableRefToBe);
                planToBe = new QueryOptimizer(services).optimize(statement, select, resolver, Collections.<PColumn>emptyList(), parallelIteratorFactory);
            } catch (MetaDataEntityNotFoundException e) {
                // Catch column/column family not found exception, as our meta data may
                // be out of sync. Update the cache once and retry if we were out of sync.
                // Otherwise throw, as we'll just get the same error next time.
                if (retryOnce) {
View Full Code Here

Examples of org.apache.phoenix.optimize.QueryOptimizer

                Collections.<ParseNode>emptyList(), null,
                delete.getOrderBy(), delete.getLimit(),
                delete.getBindCount(), false);
        select = StatementNormalizer.normalize(select, resolver);
        DeletingParallelIteratorFactory parallelIteratorFactory = hasLimit ? null : new DeletingParallelIteratorFactory(connection, tableRef);
        final QueryPlan plan = new QueryOptimizer(services).optimize(statement, select, resolver, Collections.<PColumn>emptyList(), parallelIteratorFactory);
        if (!plan.getTableRef().equals(tableRef)) {
            runOnServer = false;
            noQueryReqd = false;
        }
       
View Full Code Here

Examples of org.apache.phoenix.optimize.QueryOptimizer

                hint = HintNode.create(hint, Hint.USE_DATA_OVER_INDEX_TABLE);
            }
            select = SelectStatement.create(select, hint);
            // Pass scan through if same table in upsert and select so that projection is computed correctly
            // Use optimizer to choose the best plan
            plan = new QueryOptimizer(services).optimize(statement, select, selectResolver, targetColumns, parallelIteratorFactory);
            runOnServer &= plan.getTableRef().equals(tableRef);
            rowProjectorToBe = plan.getProjector();
            nValuesToSet = rowProjectorToBe.getColumnCount();
            // Cannot auto commit if doing aggregation or topN or salted
            // Salted causes problems because the row may end up living on a different region
View Full Code Here

Examples of org.apache.phoenix.optimize.QueryOptimizer

                options.getQueueSize());
        this.memoryManager = new GlobalMemoryManager(
                Runtime.getRuntime().maxMemory() * options.getMaxMemoryPerc() / 100,
                options.getMaxMemoryWaitMs());
        this.props = options.getProps();
        this.queryOptimizer = new QueryOptimizer(this);
    }
View Full Code Here

Examples of org.eurekastreams.commons.hibernate.QueryOptimizer

     */
    @Test
    public final void findLinkTest()
    {
        final EntityManager entityManager = context.mock(EntityManager.class);
        final QueryOptimizer queryOptimizer = context.mock(QueryOptimizer.class);
        final Query query = context.mock(Query.class);

        final UniqueStringRequest req = new UniqueStringRequest("http://www.someurl.com");
        sut.setEntityManager(entityManager);
        sut.setQueryOptimizer(queryOptimizer);
View Full Code Here

Examples of org.eurekastreams.commons.hibernate.QueryOptimizer

     */
    @Test
    public final void findExpiredLinkTest()
    {
        final EntityManager entityManager = context.mock(EntityManager.class);
        final QueryOptimizer queryOptimizer = context.mock(QueryOptimizer.class);
        final Query query = context.mock(Query.class);

        final UniqueStringRequest req = new UniqueStringRequest("http://www.someurl.com");
        sut.setEntityManager(entityManager);
        sut.setQueryOptimizer(queryOptimizer);
View Full Code Here

Examples of org.eurekastreams.commons.hibernate.QueryOptimizer

    @SuppressWarnings("unchecked")
    @Test
    public void testExecute()
    {
        final EntityManager entityManager = context.mock(EntityManager.class);
        final QueryOptimizer queryOptimizer = context.mock(QueryOptimizer.class);
        final FindByIdRequest req = context.mock(FindByIdRequest.class);
        final Query query = context.mock(Query.class);
        final List<Activity> activities = context.mock(List.class);
        final Activity activity = context.mock(Activity.class);
View Full Code Here

Examples of org.eurekastreams.commons.hibernate.QueryOptimizer

    @SuppressWarnings("unchecked")
    @Test
    public void testExecuteNoneFound()
    {
        final EntityManager entityManager = context.mock(EntityManager.class);
        final QueryOptimizer queryOptimizer = context.mock(QueryOptimizer.class);
        final FindByIdRequest req = context.mock(FindByIdRequest.class);
        final Query query = context.mock(Query.class);
        final List<Activity> activities = context.mock(List.class);

        FindByIdMapper<Activity> sut = new FindByIdMapper();
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.