use of com.facebook.airlift.event.client.JsonEventModule in project presto by prestodb.
the class PrestoServer method run.
@Override
public void run() {
verifyJvmRequirements();
verifySystemTimeIsReasonable();
Logger log = Logger.get(PrestoServer.class);
ImmutableList.Builder<Module> modules = ImmutableList.builder();
modules.add(new NodeModule(), new DiscoveryModule(), new HttpServerModule(), new JsonModule(), installModuleIf(FeaturesConfig.class, FeaturesConfig::isJsonSerdeCodeGenerationEnabled, binder -> jsonBinder(binder).addModuleBinding().to(AfterburnerModule.class)), new SmileModule(), new JaxrsModule(true), new MBeanModule(), new JmxModule(), new JmxHttpModule(), new LogJmxModule(), new TraceTokenModule(), new JsonEventModule(), new HttpEventModule(), new ServerSecurityModule(), new AccessControlModule(), new EventListenerModule(), new ServerMainModule(sqlParserOptions), new GracefulShutdownModule(), new WarningCollectorModule(), new TempStorageModule(), new QueryPrerequisitesManagerModule(), new NodeTtlFetcherManagerModule(), new ClusterTtlProviderManagerModule());
modules.addAll(getAdditionalModules());
Bootstrap app = new Bootstrap(modules.build());
try {
Injector injector = app.initialize();
injector.getInstance(PluginManager.class).loadPlugins();
ServerConfig serverConfig = injector.getInstance(ServerConfig.class);
if (!serverConfig.isResourceManager()) {
injector.getInstance(StaticCatalogStore.class).loadCatalogs();
}
// TODO: remove this huge hack
updateConnectorIds(injector.getInstance(Announcer.class), injector.getInstance(CatalogManager.class), injector.getInstance(ServerConfig.class), injector.getInstance(NodeSchedulerConfig.class));
// TODO: thrift server port should be announced by discovery server similar to http/https ports
updateThriftServerPort(injector.getInstance(Announcer.class), injector.getInstance(DriftServer.class));
injector.getInstance(StaticFunctionNamespaceStore.class).loadFunctionNamespaceManagers();
injector.getInstance(SessionPropertyDefaults.class).loadConfigurationManager();
injector.getInstance(ResourceGroupManager.class).loadConfigurationManager();
if (!serverConfig.isResourceManager()) {
injector.getInstance(AccessControlManager.class).loadSystemAccessControl();
}
injector.getInstance(PasswordAuthenticatorManager.class).loadPasswordAuthenticator();
injector.getInstance(EventListenerManager.class).loadConfiguredEventListener();
injector.getInstance(TempStorageManager.class).loadTempStorages();
injector.getInstance(QueryPrerequisitesManager.class).loadQueryPrerequisites();
injector.getInstance(NodeTtlFetcherManager.class).loadNodeTtlFetcher();
injector.getInstance(ClusterTtlProviderManager.class).loadClusterTtlProvider();
injector.getInstance(Announcer.class).start();
log.info("======== SERVER STARTED ========");
} catch (Throwable e) {
log.error(e);
System.exit(1);
}
}
Aggregations