Search in sources :

Example 1 with MySqlFunctionNamespaceManagerModule

use of com.facebook.presto.functionNamespace.mysql.MySqlFunctionNamespaceManagerModule 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);
    }
}
Also used : MySqlFunctionNamespaceManagerModule(com.facebook.presto.functionNamespace.mysql.MySqlFunctionNamespaceManagerModule) SimpleAddressSqlFunctionExecutorsModule(com.facebook.presto.functionNamespace.execution.SimpleAddressSqlFunctionExecutorsModule) DriftNettyClientModule(com.facebook.drift.transport.netty.client.DriftNettyClientModule) Injector(com.google.inject.Injector) Bootstrap(com.facebook.airlift.bootstrap.Bootstrap)

Aggregations

Bootstrap (com.facebook.airlift.bootstrap.Bootstrap)1 DriftNettyClientModule (com.facebook.drift.transport.netty.client.DriftNettyClientModule)1 SimpleAddressSqlFunctionExecutorsModule (com.facebook.presto.functionNamespace.execution.SimpleAddressSqlFunctionExecutorsModule)1 MySqlFunctionNamespaceManagerModule (com.facebook.presto.functionNamespace.mysql.MySqlFunctionNamespaceManagerModule)1 Injector (com.google.inject.Injector)1