use of com.facebook.presto.functionNamespace.execution.SimpleAddressSqlFunctionExecutorsModule in project presto by prestodb.
the class MySqlFunctionNamespaceManagerFactory method create.
@Override
public FunctionNamespaceManager<?> create(String catalogName, Map<String, String> config, FunctionNamespaceManagerContext context) {
try {
Bootstrap app = new Bootstrap(new MySqlFunctionNamespaceManagerModule(catalogName), new MySqlConnectionModule(), new SimpleAddressSqlFunctionExecutorsModule());
Injector injector = app.doNotInitializeLogging().setRequiredConfigurationProperties(config).initialize();
return injector.getInstance(MySqlFunctionNamespaceManager.class);
} catch (Exception e) {
throwIfUnchecked(e);
throw new RuntimeException(e);
}
}
use of com.facebook.presto.functionNamespace.execution.SimpleAddressSqlFunctionExecutorsModule in project presto by prestodb.
the class TestMySqlFunctionNamespaceManager method setup.
@BeforeClass
public void setup() throws Exception {
this.mySqlServer = new TestingMySqlServer("testuser", "testpass", DB);
Bootstrap app = new Bootstrap(new MySqlFunctionNamespaceManagerModule(TEST_CATALOG), new SimpleAddressSqlFunctionExecutorsModule(), new DriftNettyClientModule(), new MySqlConnectionModule());
Map<String, String> config = ImmutableMap.<String, String>builder().put("function-cache-expiration", "0s").put("function-instance-cache-expiration", "0s").put("database-url", mySqlServer.getJdbcUrl(DB)).build();
try {
this.injector = app.doNotInitializeLogging().setRequiredConfigurationProperties(config).initialize();
this.functionNamespaceManager = injector.getInstance(MySqlFunctionNamespaceManager.class);
this.jdbi = injector.getInstance(Jdbi.class);
} catch (Exception e) {
throwIfUnchecked(e);
throw new RuntimeException(e);
}
}
use of com.facebook.presto.functionNamespace.execution.SimpleAddressSqlFunctionExecutorsModule in project presto by prestodb.
the class H2FunctionNamespaceManagerFactory method create.
@Override
public FunctionNamespaceManager<?> create(String catalogName, Map<String, String> config, FunctionNamespaceManagerContext context) {
try {
Bootstrap app = new Bootstrap(new DriftNettyClientModule(), new MySqlFunctionNamespaceManagerModule(catalogName), new H2ConnectionModule(), new SimpleAddressSqlFunctionExecutorsModule());
Injector injector = app.doNotInitializeLogging().setRequiredConfigurationProperties(config).initialize();
return injector.getInstance(MySqlFunctionNamespaceManager.class);
} catch (Exception e) {
throwIfUnchecked(e);
throw new RuntimeException(e);
}
}
Aggregations