use of org.apache.flink.table.delegation.ExecutorFactory in project zeppelin by apache.
the class Flink113Shims method lookupExecutor.
private Object lookupExecutor(ClassLoader classLoader, Object settings, Object sEnv) {
try {
Map<String, String> executorProperties = ((EnvironmentSettings) settings).toExecutorProperties();
ExecutorFactory executorFactory = ComponentFactoryService.find(ExecutorFactory.class, executorProperties);
Method createMethod = executorFactory.getClass().getMethod("create", Map.class, StreamExecutionEnvironment.class);
return createMethod.invoke(executorFactory, executorProperties, sEnv);
} catch (Exception e) {
throw new TableException("Could not instantiate the executor. Make sure a planner module is on the classpath", e);
}
}
use of org.apache.flink.table.delegation.ExecutorFactory in project zeppelin by apache.
the class Flink114Shims method lookupExecutor.
private Object lookupExecutor(ClassLoader classLoader, Object settings, Object sEnv) {
try {
final ExecutorFactory executorFactory = FactoryUtil.discoverFactory(classLoader, ExecutorFactory.class, ((EnvironmentSettings) settings).getExecutor());
final Method createMethod = executorFactory.getClass().getMethod("create", StreamExecutionEnvironment.class);
return createMethod.invoke(executorFactory, sEnv);
} catch (Exception e) {
throw new TableException("Could not instantiate the executor. Make sure a planner module is on the classpath", e);
}
}
use of org.apache.flink.table.delegation.ExecutorFactory in project zeppelin by apache.
the class Flink112Shims method lookupExecutor.
private Object lookupExecutor(ClassLoader classLoader, Object settings, Object sEnv) {
try {
Map<String, String> executorProperties = ((EnvironmentSettings) settings).toExecutorProperties();
ExecutorFactory executorFactory = ComponentFactoryService.find(ExecutorFactory.class, executorProperties);
Method createMethod = executorFactory.getClass().getMethod("create", Map.class, StreamExecutionEnvironment.class);
return (Executor) createMethod.invoke(executorFactory, executorProperties, (StreamExecutionEnvironment) sEnv);
} catch (Exception e) {
throw new TableException("Could not instantiate the executor. Make sure a planner module is on the classpath", e);
}
}
use of org.apache.flink.table.delegation.ExecutorFactory in project flink by apache.
the class ExecutionContext method lookupExecutor.
private Executor lookupExecutor(String executorIdentifier, StreamExecutionEnvironment executionEnvironment) {
try {
final ExecutorFactory executorFactory = FactoryUtil.discoverFactory(classLoader, ExecutorFactory.class, executorIdentifier);
final Method createMethod = executorFactory.getClass().getMethod("create", StreamExecutionEnvironment.class);
return (Executor) createMethod.invoke(executorFactory, executionEnvironment);
} catch (Exception e) {
throw new TableException("Could not instantiate the executor. Make sure a planner module is on the classpath", e);
}
}
use of org.apache.flink.table.delegation.ExecutorFactory in project flink by apache.
the class TableEnvironmentImpl method create.
private static TableEnvironmentImpl create(EnvironmentSettings settings, Configuration configuration) {
// temporary solution until FLINK-15635 is fixed
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
// use configuration to init table config
final TableConfig tableConfig = new TableConfig();
tableConfig.addConfiguration(configuration);
final ModuleManager moduleManager = new ModuleManager();
final CatalogManager catalogManager = CatalogManager.newBuilder().classLoader(classLoader).config(tableConfig.getConfiguration()).defaultCatalog(settings.getBuiltInCatalogName(), new GenericInMemoryCatalog(settings.getBuiltInCatalogName(), settings.getBuiltInDatabaseName())).build();
final FunctionCatalog functionCatalog = new FunctionCatalog(tableConfig, catalogManager, moduleManager);
final ExecutorFactory executorFactory = FactoryUtil.discoverFactory(classLoader, ExecutorFactory.class, settings.getExecutor());
final Executor executor = executorFactory.create(configuration);
final Planner planner = PlannerFactoryUtil.createPlanner(settings.getPlanner(), executor, tableConfig, moduleManager, catalogManager, functionCatalog);
return new TableEnvironmentImpl(catalogManager, moduleManager, tableConfig, executor, functionCatalog, planner, settings.isStreamingMode(), classLoader);
}
Aggregations