Search in sources :

Example 1 with PlanCompiler

use of org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler in project asterixdb by apache.

the class AbstractPhysicalOperator method compileSubplans.

protected AlgebricksPipeline[] compileSubplans(IOperatorSchema outerPlanSchema, AbstractOperatorWithNestedPlans npOp, IOperatorSchema opSchema, JobGenContext context) throws AlgebricksException {
    AlgebricksPipeline[] subplans = new AlgebricksPipeline[npOp.getNestedPlans().size()];
    PlanCompiler pc = new PlanCompiler(context);
    int i = 0;
    for (ILogicalPlan p : npOp.getNestedPlans()) {
        subplans[i++] = buildPipelineWithProjection(p, outerPlanSchema, npOp, opSchema, pc);
    }
    return subplans;
}
Also used : PlanCompiler(org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler) ILogicalPlan(org.apache.hyracks.algebricks.core.algebra.base.ILogicalPlan) AlgebricksPipeline(org.apache.hyracks.algebricks.runtime.base.AlgebricksPipeline) AlgebricksPartitionConstraint(org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint) AlgebricksCountPartitionConstraint(org.apache.hyracks.algebricks.common.constraints.AlgebricksCountPartitionConstraint)

Example 2 with PlanCompiler

use of org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler in project asterixdb by apache.

the class HeuristicCompilerFactoryBuilder method create.

@Override
public ICompilerFactory create() {
    return new ICompilerFactory() {

        @Override
        public ICompiler createCompiler(final ILogicalPlan plan, final IMetadataProvider<?, ?> metadata, int varCounter) {
            final IOptimizationContext oc = optCtxFactory.createOptimizationContext(varCounter, expressionEvalSizeComputer, mergeAggregationExpressionFactory, expressionTypeComputer, missableTypeComputer, conflictingTypeResolver, physicalOptimizationConfig, clusterLocations);
            oc.setMetadataDeclarations(metadata);
            final HeuristicOptimizer opt = new HeuristicOptimizer(plan, logicalRewrites, physicalRewrites, oc);
            return new ICompiler() {

                @Override
                public void optimize() throws AlgebricksException {
                    opt.optimize();
                }

                @Override
                public JobSpecification createJob(Object appContext, IJobletEventListenerFactory jobEventListenerFactory) throws AlgebricksException {
                    AlgebricksConfig.ALGEBRICKS_LOGGER.fine("Starting Job Generation.\n");
                    JobGenContext context = new JobGenContext(null, metadata, appContext, serializerDeserializerProvider, hashFunctionFactoryProvider, hashFunctionFamilyProvider, comparatorFactoryProvider, typeTraitProvider, binaryBooleanInspectorFactory, binaryIntegerInspectorFactory, printerProvider, missingWriterFactory, normalizedKeyComputerFactoryProvider, expressionRuntimeProvider, expressionTypeComputer, oc, expressionEvalSizeComputer, partialAggregationTypeComputer, predEvaluatorFactoryProvider, physicalOptimizationConfig.getFrameSize(), clusterLocations);
                    PlanCompiler pc = new PlanCompiler(context);
                    return pc.compilePlan(plan, null, jobEventListenerFactory);
                }
            };
        }
    };
}
Also used : PlanCompiler(org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler) IOptimizationContext(org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext) ILogicalPlan(org.apache.hyracks.algebricks.core.algebra.base.ILogicalPlan) IMetadataProvider(org.apache.hyracks.algebricks.core.algebra.metadata.IMetadataProvider) HeuristicOptimizer(org.apache.hyracks.algebricks.core.rewriter.base.HeuristicOptimizer) IJobletEventListenerFactory(org.apache.hyracks.api.job.IJobletEventListenerFactory) JobGenContext(org.apache.hyracks.algebricks.core.jobgen.impl.JobGenContext)

Aggregations

ILogicalPlan (org.apache.hyracks.algebricks.core.algebra.base.ILogicalPlan)2 PlanCompiler (org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler)2 AlgebricksCountPartitionConstraint (org.apache.hyracks.algebricks.common.constraints.AlgebricksCountPartitionConstraint)1 AlgebricksPartitionConstraint (org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint)1 IOptimizationContext (org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext)1 IMetadataProvider (org.apache.hyracks.algebricks.core.algebra.metadata.IMetadataProvider)1 JobGenContext (org.apache.hyracks.algebricks.core.jobgen.impl.JobGenContext)1 HeuristicOptimizer (org.apache.hyracks.algebricks.core.rewriter.base.HeuristicOptimizer)1 AlgebricksPipeline (org.apache.hyracks.algebricks.runtime.base.AlgebricksPipeline)1 IJobletEventListenerFactory (org.apache.hyracks.api.job.IJobletEventListenerFactory)1