use of io.trino.server.security.PasswordAuthenticatorManager in project trino by trinodb.
the class Server method doStart.
private void doStart(String trinoVersion) {
verifyJvmRequirements();
verifySystemTimeIsReasonable();
Logger log = Logger.get(Server.class);
log.info("Java version: %s", StandardSystemProperty.JAVA_VERSION.value());
ImmutableList.Builder<Module> modules = ImmutableList.builder();
modules.add(new NodeModule(), new DiscoveryModule(), new HttpServerModule(), new JsonModule(), new JaxrsModule(), new MBeanModule(), new PrefixObjectNameGeneratorModule("io.trino"), new JmxModule(), new JmxHttpModule(), new LogJmxModule(), new TraceTokenModule(), new EventModule(), new JsonEventModule(), new ServerSecurityModule(), new AccessControlModule(), new EventListenerModule(), new ExchangeManagerModule(), new CoordinatorDiscoveryModule(), new ServerMainModule(trinoVersion), new GracefulShutdownModule(), new WarningCollectorModule());
modules.addAll(getAdditionalModules());
Bootstrap app = new Bootstrap(modules.build());
try {
Injector injector = app.initialize();
log.info("Trino version: %s", injector.getInstance(NodeVersion.class).getVersion());
logLocation(log, "Working directory", Paths.get("."));
logLocation(log, "Etc directory", Paths.get("etc"));
injector.getInstance(PluginManager.class).loadPlugins();
injector.getInstance(StaticCatalogStore.class).loadCatalogs();
// TODO: remove this huge hack
updateConnectorIds(injector.getInstance(Announcer.class), injector.getInstance(CatalogManager.class));
injector.getInstance(SessionPropertyDefaults.class).loadConfigurationManager();
injector.getInstance(ResourceGroupManager.class).loadConfigurationManager();
injector.getInstance(AccessControlManager.class).loadSystemAccessControl();
injector.getInstance(optionalKey(PasswordAuthenticatorManager.class)).ifPresent(PasswordAuthenticatorManager::loadPasswordAuthenticator);
injector.getInstance(EventListenerManager.class).loadEventListeners();
injector.getInstance(GroupProviderManager.class).loadConfiguredGroupProvider();
injector.getInstance(ExchangeManagerRegistry.class).loadExchangeManager();
injector.getInstance(CertificateAuthenticatorManager.class).loadCertificateAuthenticator();
injector.getInstance(optionalKey(HeaderAuthenticatorManager.class)).ifPresent(HeaderAuthenticatorManager::loadHeaderAuthenticator);
injector.getInstance(Announcer.class).start();
injector.getInstance(StartupStatus.class).startupComplete();
log.info("======== SERVER STARTED ========");
} catch (ApplicationConfigurationException e) {
StringBuilder message = new StringBuilder();
message.append("Configuration is invalid\n");
message.append("==========\n");
addMessages(message, "Errors", ImmutableList.copyOf(e.getErrors()));
addMessages(message, "Warnings", ImmutableList.copyOf(e.getWarnings()));
message.append("\n");
message.append("==========");
log.error("%s", message);
System.exit(1);
} catch (Throwable e) {
log.error(e);
System.exit(1);
}
}
Aggregations