use of org.apache.flink.table.api.EnvironmentSettings 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.api.EnvironmentSettings in project zeppelin by apache.
the class Flink114Shims method createPlannerAndExecutor.
@Override
public ImmutablePair<Object, Object> createPlannerAndExecutor(ClassLoader classLoader, Object environmentSettings, Object sEnv, Object tableConfig, Object functionCatalog, Object catalogManager) {
EnvironmentSettings settings = (EnvironmentSettings) environmentSettings;
Executor executor = (Executor) lookupExecutor(classLoader, environmentSettings, sEnv);
Planner planner = PlannerFactoryUtil.createPlanner(settings.getPlanner(), executor, (TableConfig) tableConfig, (CatalogManager) catalogManager, (FunctionCatalog) functionCatalog);
return ImmutablePair.of(planner, executor);
}
use of org.apache.flink.table.api.EnvironmentSettings 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.api.EnvironmentSettings in project flink by apache.
the class CatalogITCase method getTableEnvironment.
private TableEnvironment getTableEnvironment() {
EnvironmentSettings settings = EnvironmentSettings.newInstance().inStreamingMode().build();
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
return StreamTableEnvironment.create(env, settings);
}
use of org.apache.flink.table.api.EnvironmentSettings in project flink by apache.
the class CatalogConstraintTest method setup.
@Before
public void setup() {
EnvironmentSettings settings = EnvironmentSettings.newInstance().inBatchMode().build();
tEnv = TableEnvironment.create(settings);
catalog = tEnv.getCatalog(tEnv.getCurrentCatalog()).orElse(null);
assertNotNull(catalog);
}
Aggregations