use of com.facebook.presto.operator.LocalPlannerAware in project presto by prestodb.
the class LocalExecutionPlanner method plan.
public LocalExecutionPlan plan(Session session, PlanNode plan, List<Symbol> outputLayout, Map<Symbol, Type> types, OutputFactory outputOperatorFactory) {
LocalExecutionPlanContext context = new LocalExecutionPlanContext(session, types);
PhysicalOperation physicalOperation = plan.accept(new Visitor(session), context);
Function<Page, Page> pagePreprocessor = enforceLayoutProcessor(outputLayout, physicalOperation.getLayout());
List<Type> outputTypes = outputLayout.stream().map(types::get).collect(toImmutableList());
context.addDriverFactory(context.isInputDriver(), true, ImmutableList.<OperatorFactory>builder().addAll(physicalOperation.getOperatorFactories()).add(outputOperatorFactory.createOutputOperator(context.getNextOperatorId(), plan.getId(), outputTypes, pagePreprocessor, new PagesSerdeFactory(blockEncodingSerde, isExchangeCompressionEnabled(session)))).build(), context.getDriverInstanceCount());
addLookupOuterDrivers(context);
// notify operator factories that planning has completed
context.getDriverFactories().stream().map(DriverFactory::getOperatorFactories).flatMap(List::stream).filter(LocalPlannerAware.class::isInstance).map(LocalPlannerAware.class::cast).forEach(LocalPlannerAware::localPlannerComplete);
return new LocalExecutionPlan(context.getDriverFactories());
}
Aggregations