io.airlift.json.JsonModule Java Examples

The following examples show how to use io.airlift.json.JsonModule. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PrometheusConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> requiredConfig, ConnectorContext context)
{
    requireNonNull(requiredConfig, "requiredConfig is null");
    try {
        // A plugin is not required to use Guice; it is just very convenient
        Bootstrap app = new Bootstrap(
                new JsonModule(),
                new PrometheusModule(context.getTypeManager()));

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(requiredConfig)
                .initialize();

        return injector.getInstance(PrometheusConnector.class);
    }
    catch (Exception e) {
        throwIfUnchecked(e);
        throw new RuntimeException(e);
    }
}
 
Example #2
Source File: DbResourceGroupConfigurationManagerFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public ResourceGroupConfigurationManager<?> create(Map<String, String> config, ResourceGroupConfigurationManagerContext context)
{
    Bootstrap app = new Bootstrap(
            new MBeanModule(),
            new MBeanServerModule(),
            new JsonModule(),
            new DbResourceGroupsModule(),
            new PrefixObjectNameGeneratorModule("io.prestosql.plugin.resourcegroups.db", "presto.plugin.resourcegroups.db"),
            binder -> binder.bind(String.class).annotatedWith(ForEnvironment.class).toInstance(context.getEnvironment()),
            binder -> binder.bind(ClusterMemoryPoolManager.class).toInstance(context.getMemoryPoolManager()));

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(DbResourceGroupConfigurationManager.class);
}
 
Example #3
Source File: FileResourceGroupConfigurationManagerFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public ResourceGroupConfigurationManager<?> create(Map<String, String> config, ResourceGroupConfigurationManagerContext context)
{
    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new FileResourceGroupsModule(),
            binder -> binder.bind(ClusterMemoryPoolManager.class).toInstance(context.getMemoryPoolManager()));

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(FileResourceGroupConfigurationManager.class);
}
 
Example #4
Source File: KuduConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(config, "config is null");

    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new KuduModule(context.getTypeManager()));

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(KuduConnector.class);
}
 
Example #5
Source File: CassandraConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(config, "config is null");

    Bootstrap app = new Bootstrap(
            new MBeanModule(),
            new JsonModule(),
            new CassandraClientModule(),
            new MBeanServerModule());

    Injector injector = app.strictConfig().doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(CassandraConnector.class);
}
 
Example #6
Source File: BigQueryConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(catalogName, "catalogName is null");
    requireNonNull(config, "config is null");

    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new BigQueryConnectorModule(context.getNodeManager()),
            binder -> {
                binder.bind(TypeManager.class).toInstance(context.getTypeManager());
                binder.bind(NodeManager.class).toInstance(context.getNodeManager());
            });

    Injector injector = app.strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(BigQueryConnector.class);
}
 
Example #7
Source File: KafkaConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(catalogName, "catalogName is null");
    requireNonNull(config, "config is null");

    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new KafkaConnectorModule(),
            extension,
            binder -> {
                binder.bind(ClassLoader.class).toInstance(KafkaConnectorFactory.class.getClassLoader());
                binder.bind(TypeManager.class).toInstance(context.getTypeManager());
                binder.bind(NodeManager.class).toInstance(context.getNodeManager());
            });

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(KafkaConnector.class);
}
 
Example #8
Source File: SheetsConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(config, "config is null");

    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new SheetsModule(context.getTypeManager()));

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(SheetsConnector.class);
}
 
Example #9
Source File: DbSessionPropertyManagerFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public SessionPropertyConfigurationManager create(Map<String, String> config, SessionPropertyConfigurationManagerContext context)
{
    try {
        Bootstrap app = new Bootstrap(
                new MBeanModule(),
                new MBeanServerModule(),
                new JsonModule(),
                new DbSessionPropertyManagerModule());

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(config)
                .initialize();

        return injector.getInstance(DbSessionPropertyManager.class);
    }
    catch (Exception e) {
        throwIfUnchecked(e);
        throw new RuntimeException(e);
    }
}
 
Example #10
Source File: TestingElasticsearchConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(catalogName, "catalogName is null");
    requireNonNull(config, "config is null");

    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new ElasticsearchConnectorModule(),
            binder -> {
                binder.bind(TypeManager.class).toInstance(context.getTypeManager());
                binder.bind(NodeManager.class).toInstance(context.getNodeManager());
            });

    Injector injector = app.strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(ElasticsearchConnector.class);
}
 
Example #11
Source File: ElasticsearchConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(catalogName, "catalogName is null");
    requireNonNull(config, "config is null");

    Bootstrap app = new Bootstrap(
            new MBeanModule(),
            new MBeanServerModule(),
            new ConnectorObjectNameGeneratorModule(catalogName, "io.prestosql.elasticsearch", "presto.plugin.elasticsearch"),
            new JsonModule(),
            new ElasticsearchConnectorModule(),
            binder -> {
                binder.bind(TypeManager.class).toInstance(context.getTypeManager());
                binder.bind(NodeManager.class).toInstance(context.getNodeManager());
            });

    Injector injector = app.strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(ElasticsearchConnector.class);
}
 
Example #12
Source File: PrestoProxy.java    From presto with Apache License 2.0 6 votes vote down vote up
public static void start(Module... extraModules)
{
    Bootstrap app = new Bootstrap(ImmutableList.<Module>builder()
            .add(new NodeModule())
            .add(new HttpServerModule())
            .add(new JsonModule())
            .add(new JaxrsModule())
            .add(new MBeanModule())
            .add(new JmxModule())
            .add(new LogJmxModule())
            .add(new TraceTokenModule())
            .add(new EventModule())
            .add(new ProxyModule())
            .add(extraModules)
            .build());

    Logger log = Logger.get(PrestoProxy.class);
    try {
        app.strictConfig().initialize();
        log.info("======== SERVER STARTED ========");
    }
    catch (Throwable t) {
        log.error(t);
        System.exit(1);
    }
}
 
Example #13
Source File: MemoryConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> requiredConfig, ConnectorContext context)
{
    requireNonNull(requiredConfig, "requiredConfig is null");

    // A plugin is not required to use Guice; it is just very convenient
    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new MemoryModule(context.getTypeManager(), context.getNodeManager()));

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(requiredConfig)
            .initialize();

    return injector.getInstance(MemoryConnector.class);
}
 
Example #14
Source File: MongoConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(config, "config is null");

    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new MongoClientModule(),
            binder -> binder.bind(TypeManager.class).toInstance(context.getTypeManager()));

    Injector injector = app.strictConfig().doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(MongoConnector.class);
}
 
Example #15
Source File: PinotConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(catalogName, "connectorId is null");
    requireNonNull(config, "config is null");
    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new MBeanModule(),
            new PinotModule(catalogName, context.getTypeManager(), context.getNodeManager()));

    Injector injector = app.strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(PinotConnector.class);
}
 
Example #16
Source File: ParaflowConnectorFactory.java    From paraflow with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String connectorId, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(config, "config is null");

    try {
        Bootstrap app = new Bootstrap(
                new JsonModule(),
                new ParaflowModule(connectorId, context.getTypeManager())
        );

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(config)
                .initialize();

        return injector.getInstance(ParaflowConnector.class);
    }
    catch (Exception e) {
        throw new PrestoException(CONNECTOR_INIT_ERROR, e);
    }
}
 
Example #17
Source File: KuduConnectorFactory.java    From presto-kudu with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String connectorId, Map<String, String> config,
                        ConnectorContext context) {
    requireNonNull(config, "config is null");

    try {
        Bootstrap app = new Bootstrap(new JsonModule(),
                new KuduModule(connectorId, context.getTypeManager()));

        Injector injector =
                app.strictConfig().doNotInitializeLogging().setRequiredConfigurationProperties(config)
                        .initialize();

        return injector.getInstance(KuduConnector.class);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example #18
Source File: PhoenixConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> requiredConfig, ConnectorContext context)
{
    requireNonNull(requiredConfig, "requiredConfig is null");

    try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
        Bootstrap app = new Bootstrap(
                new JsonModule(),
                new MBeanServerModule(),
                new MBeanModule(),
                new PhoenixClientModule(catalogName),
                binder -> {
                    binder.bind(ClassLoader.class).toInstance(PhoenixConnectorFactory.class.getClassLoader());
                    binder.bind(TypeManager.class).toInstance(context.getTypeManager());
                });

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(requiredConfig)
                .initialize();

        return injector.getInstance(PhoenixConnector.class);
    }
}
 
Example #19
Source File: AccumuloConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(catalogName, "catalogName is null");
    requireNonNull(config, "requiredConfig is null");
    requireNonNull(context, "context is null");

    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new AccumuloModule(context.getTypeManager()));

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(AccumuloConnector.class);
}
 
Example #20
Source File: H2ResourceGroupConfigurationManagerFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public ResourceGroupConfigurationManager<?> create(Map<String, String> config, ResourceGroupConfigurationManagerContext context)
{
    try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
        Bootstrap app = new Bootstrap(
                new JsonModule(),
                new H2ResourceGroupsModule(),
                new NodeModule(),
                binder -> binder.bind(ResourceGroupConfigurationManagerContext.class).toInstance(context),
                binder -> binder.bind(ClusterMemoryPoolManager.class).toInstance(context.getMemoryPoolManager()));

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(config)
                .quiet()
                .initialize();

        return injector.getInstance(DbResourceGroupConfigurationManager.class);
    }
}
 
Example #21
Source File: ExampleConnectorFactory.java    From presto with Apache License 2.0 6 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> requiredConfig, ConnectorContext context)
{
    requireNonNull(requiredConfig, "requiredConfig is null");

    // A plugin is not required to use Guice; it is just very convenient
    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new ExampleModule(context.getTypeManager()));

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(requiredConfig)
            .initialize();

    return injector.getInstance(ExampleConnector.class);
}
 
Example #22
Source File: TestProxyServer.java    From presto with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public void setupServer()
        throws Exception
{
    byte[] sharedSecret = Base64.getMimeEncoder().encode("test secret".getBytes(US_ASCII));
    sharedSecretFile = Files.createTempFile("secret", "txt");
    Files.write(sharedSecretFile, sharedSecret);

    Logging.initialize();
    server = TestingPrestoServer.create();
    server.installPlugin(new TpchPlugin());
    server.createCatalog("tpch", "tpch");
    server.installPlugin(new BlackHolePlugin());
    server.createCatalog("blackhole", "blackhole");
    server.refreshNodes();

    Bootstrap app = new Bootstrap(
            new TestingNodeModule("test"),
            new TestingHttpServerModule(),
            new JsonModule(),
            new JaxrsModule(),
            new TestingJmxModule(),
            new ProxyModule());

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperty("proxy.uri", server.getBaseUrl().toString())
            .setRequiredConfigurationProperty("proxy.shared-secret-file", sharedSecretFile.toString())
            .quiet()
            .initialize();

    lifeCycleManager = injector.getInstance(LifeCycleManager.class);
    httpServerInfo = injector.getInstance(HttpServerInfo.class);

    executorService = newCachedThreadPool(daemonThreadsNamed("test-%s"));

    setupTestTable();
}
 
Example #23
Source File: AtopConnectorFactory.java    From presto with Apache License 2.0 5 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> requiredConfig, ConnectorContext context)
{
    requireNonNull(requiredConfig, "requiredConfig is null");

    try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
        Bootstrap app = new Bootstrap(
                new AtopModule(
                        atopFactoryClass,
                        context.getTypeManager(),
                        context.getNodeManager(),
                        context.getNodeManager().getEnvironment(),
                        catalogName),
                installModuleIf(
                        AtopConnectorConfig.class,
                        config -> config.getSecurity() == AtopSecurity.NONE,
                        new AllowAllAccessControlModule()),
                installModuleIf(
                        AtopConnectorConfig.class,
                        config -> config.getSecurity() == AtopSecurity.FILE,
                        binder -> {
                            binder.install(new FileBasedAccessControlModule(catalogName));
                            binder.install(new JsonModule());
                        }));

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(requiredConfig)
                .initialize();

        return injector.getInstance(AtopConnector.class);
    }
}
 
Example #24
Source File: TestingKinesisConnectorFactory.java    From presto with Apache License 2.0 5 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(catalogName, "connectorId is null");
    requireNonNull(config, "config is null");

    try {
        Bootstrap app = new Bootstrap(
                new JsonModule(),
                new KinesisModule(),
                binder -> {
                    binder.bind(TypeManager.class).toInstance(context.getTypeManager());
                    binder.bind(NodeManager.class).toInstance(context.getNodeManager());
                    binder.bind(KinesisHandleResolver.class).toInstance(new KinesisHandleResolver());
                    binder.bind(KinesisClientProvider.class).toInstance(kinesisClientProvider);
                    binder.bind(new TypeLiteral<Supplier<Map<SchemaTableName, KinesisStreamDescription>>>() {}).to(KinesisTableDescriptionSupplier.class).in(Scopes.SINGLETON);
                });

        Injector injector = app.strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(config)
                .initialize();

        KinesisConnector connector = injector.getInstance(KinesisConnector.class);
        return connector;
    }
    catch (Exception e) {
        throwIfUnchecked(e);
        throw new RuntimeException(e);
    }
}
 
Example #25
Source File: PulsarConnectorFactory.java    From pulsar with Apache License 2.0 5 votes vote down vote up
@Override
public Connector create(String connectorId, Map<String, String> config, ConnectorContext context) {
    requireNonNull(config, "requiredConfig is null");
    if (log.isDebugEnabled()) {
        log.debug("Creating Pulsar connector with configs: %s", config);
    }
    try {
        // A plugin is not required to use Guice; it is just very convenient
        Bootstrap app = new Bootstrap(
                new JsonModule(),
                new PulsarConnectorModule(connectorId, context.getTypeManager())
        );

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(config)
                .initialize();

        PulsarConnector connector = injector.getInstance(PulsarConnector.class);
        connector.initConnectorCache();
        return connector;
    } catch (Exception e) {
        throwIfUnchecked(e);
        throw new RuntimeException(e);
    }
}
 
Example #26
Source File: TestDbSessionPropertyManagerIntegration.java    From presto with Apache License 2.0 5 votes vote down vote up
@Override
public SessionPropertyConfigurationManager create(Map<String, String> config, SessionPropertyConfigurationManagerContext context)
{
    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new TestingDbSessionPropertyManagerModule());

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .quiet()
            .initialize();
    return injector.getInstance(DbSessionPropertyManager.class);
}
 
Example #27
Source File: KinesisConnectorFactory.java    From presto with Apache License 2.0 5 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    requireNonNull(catalogName, "catalogName is null");
    requireNonNull(config, "config is null");

    try {
        Bootstrap app = new Bootstrap(
                new JsonModule(),
                new KinesisModule(),
                binder -> {
                    binder.bind(TypeManager.class).toInstance(context.getTypeManager());
                    binder.bind(NodeManager.class).toInstance(context.getNodeManager());
                    binder.bind(KinesisHandleResolver.class).toInstance(new KinesisHandleResolver());
                    binder.bind(KinesisClientProvider.class).to(KinesisClientManager.class).in(Scopes.SINGLETON);
                    binder.bind(new TypeLiteral<Supplier<Map<SchemaTableName, KinesisStreamDescription>>>() {}).to(KinesisTableDescriptionSupplier.class).in(Scopes.SINGLETON);
                });

        Injector injector = app.strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(config)
                .initialize();

        KinesisConnector connector = injector.getInstance(KinesisConnector.class);
        return connector;
    }
    catch (Exception e) {
        throwIfUnchecked(e);
        throw new RuntimeException(e);
    }
}
 
Example #28
Source File: FileSessionPropertyManagerFactory.java    From presto with Apache License 2.0 5 votes vote down vote up
@Override
public SessionPropertyConfigurationManager create(Map<String, String> config, SessionPropertyConfigurationManagerContext context)
{
    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new FileSessionPropertyManagerModule());

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(FileSessionPropertyManager.class);
}
 
Example #29
Source File: TestHttpBackupStore.java    From presto with Apache License 2.0 5 votes vote down vote up
@BeforeMethod
public void setup()
{
    temporary = createTempDir();

    Map<String, String> properties = ImmutableMap.<String, String>builder()
            .put("backup.http.uri", "http://localhost:8080")
            .build();

    Bootstrap app = new Bootstrap(
            new TestingNodeModule(),
            new TestingHttpServerModule(),
            new JsonModule(),
            new JaxrsModule(),
            binder -> jaxrsBinder(binder).bind(TestingHttpBackupResource.class),
            binder -> binder.bind(NodeManager.class).toInstance(new TestingNodeManager()),
            override(new HttpBackupModule()).with(new TestingModule()));

    Injector injector = app
            .strictConfig()
            .setRequiredConfigurationProperties(properties)
            .doNotInitializeLogging()
            .quiet()
            .initialize();

    lifeCycleManager = injector.getInstance(LifeCycleManager.class);

    store = injector.getInstance(BackupStore.class);
}
 
Example #30
Source File: RaptorConnectorFactory.java    From presto with Apache License 2.0 5 votes vote down vote up
@Override
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context)
{
    Bootstrap app = new Bootstrap(
            new JsonModule(),
            new MBeanModule(),
            new ConnectorObjectNameGeneratorModule(catalogName, "io.prestosql.plugin.raptor.legacy", "presto.plugin.raptor.legacy"),
            new MBeanServerModule(),
            binder -> {
                binder.bind(NodeManager.class).toInstance(context.getNodeManager());
                binder.bind(PageSorter.class).toInstance(context.getPageSorter());
                binder.bind(TypeManager.class).toInstance(context.getTypeManager());
            },
            metadataModule,
            new BackupModule(backupProviders),
            new StorageModule(),
            new RaptorModule(catalogName),
            new RaptorSecurityModule(catalogName));

    Injector injector = app
            .strictConfig()
            .doNotInitializeLogging()
            .setRequiredConfigurationProperties(config)
            .initialize();

    return injector.getInstance(RaptorConnector.class);
}