use of com.facebook.presto.raptor.storage.StorageModule in project presto by prestodb.
the class RaptorConnectorFactory method create.
@Override
public Connector create(String connectorId, Map<String, String> config, ConnectorContext context) {
NodeManager nodeManager = context.getNodeManager();
try {
Bootstrap app = new Bootstrap(new JsonModule(), new MBeanModule(), binder -> {
MBeanServer mbeanServer = new RebindSafeMBeanServer(getPlatformMBeanServer());
binder.bind(MBeanServer.class).toInstance(mbeanServer);
binder.bind(NodeManager.class).toInstance(nodeManager);
binder.bind(PageSorter.class).toInstance(context.getPageSorter());
binder.bind(TypeManager.class).toInstance(context.getTypeManager());
}, metadataModule, new BackupModule(backupProviders), new StorageModule(connectorId), new RaptorModule(connectorId));
Injector injector = app.strictConfig().doNotInitializeLogging().setRequiredConfigurationProperties(config).initialize();
return injector.getInstance(RaptorConnector.class);
} catch (Exception e) {
throw Throwables.propagate(e);
}
}
Aggregations