use of org.apache.flink.table.delegation.PlannerFactory in project flink by apache.
the class PlannerFactoryUtil method createPlanner.
/**
* Discovers a planner factory and creates a planner instance.
*/
public static Planner createPlanner(String plannerIdentifier, Executor executor, TableConfig tableConfig, ModuleManager moduleManager, CatalogManager catalogManager, FunctionCatalog functionCatalog) {
final PlannerFactory plannerFactory = FactoryUtil.discoverFactory(Thread.currentThread().getContextClassLoader(), PlannerFactory.class, plannerIdentifier);
final Context context = new DefaultPlannerContext(executor, tableConfig, moduleManager, catalogManager, functionCatalog);
return plannerFactory.create(context);
}
use of org.apache.flink.table.delegation.PlannerFactory in project flink by apache.
the class LoaderITCase method testPlannerFactory.
@Test
public void testPlannerFactory() {
assertThat(DelegatePlannerFactory.class.getClassLoader().getResourceAsStream(FLINK_TABLE_PLANNER_FAT_JAR)).isNotNull();
PlannerFactory plannerFactory = FactoryUtil.discoverFactory(LoaderITCase.class.getClassLoader(), PlannerFactory.class, PlannerFactory.DEFAULT_IDENTIFIER);
assertThat(plannerFactory).isNotNull().isInstanceOf(DelegatePlannerFactory.class);
assertThat(plannerFactory.factoryIdentifier()).isEqualTo(PlannerFactory.DEFAULT_IDENTIFIER);
}
Aggregations