From 28ea884e19dbbc6053e8d559d670499a6df5c222 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 16 May 2024 10:01:22 +0000 Subject: [PATCH] almost ready? --- .../org/apache/druid/quidem/Launcher.java | 96 ++++++++++--------- .../sql/calcite/util/SqlTestFramework.java | 14 ++- 2 files changed, 60 insertions(+), 50 deletions(-) diff --git a/integration-tests/src/main/java/org/apache/druid/quidem/Launcher.java b/integration-tests/src/main/java/org/apache/druid/quidem/Launcher.java index 124a956198e..4883cf5dbd6 100644 --- a/integration-tests/src/main/java/org/apache/druid/quidem/Launcher.java +++ b/integration-tests/src/main/java/org/apache/druid/quidem/Launcher.java @@ -65,7 +65,7 @@ import org.apache.druid.guice.http.HttpClientModule; import org.apache.druid.guice.security.AuthenticatorModule; import org.apache.druid.guice.security.AuthorizerModule; import org.apache.druid.guice.security.DruidAuthModule; -import org.apache.druid.guice.security.EscalatorModule; +import org.apache.druid.initialization.CoreInjectorBuilder; import org.apache.druid.initialization.DruidModule; import org.apache.druid.initialization.Log4jShutterDownerModule; import org.apache.druid.initialization.TombstoneDataStorageModule; @@ -85,8 +85,6 @@ import org.apache.druid.server.QueryLifecycleFactory; import org.apache.druid.server.QueryScheduler; import org.apache.druid.server.QuerySchedulerProvider; import org.apache.druid.server.SpecificSegmentsQuerySegmentWalker; -import org.apache.druid.server.initialization.AuthenticatorMapperModule; -import org.apache.druid.server.initialization.AuthorizerMapperModule; import org.apache.druid.server.initialization.ExternalStorageAccessSecurityModule; import org.apache.druid.server.initialization.jetty.JettyServerModule; import org.apache.druid.server.log.RequestLogger; @@ -554,12 +552,18 @@ public class Launcher @Override public void configureGuice(DruidInjectorBuilder builder) + { + throw new RuntimeException("f"); + } + + @Override + public void configureGuice(CoreInjectorBuilder builder, List overrideModules) { delegate.configureGuice(builder); TestRequestLogger testRequestLogger = new TestRequestLogger(); // builder.addModule(connectionModule); -// builder.addModule(new DiscovertModule()); + overrideModules.add(new DiscovertModule()); if(false) { builder.addModule(new LegacyBrokerParallelMergeConfigModule()); @@ -571,48 +575,6 @@ public class Launcher builder.addModule(new BrokerServiceModule()); } - if(false) { - builder.addModules( - new Log4jShutterDownerModule(), - new LifecycleModule(), -// ExtensionsModule.SecondaryModule.class, - new DruidAuthModule(), -// TLSCertificateCheckerModule.class, -// EmitterModule.class, - HttpClientModule.global(), - HttpClientModule.escalatedGlobal(), - new HttpClientModule("druid.broker.http", Client.class, true), - new HttpClientModule("druid.broker.http", EscalatedClient.class, true), - new CuratorModule(), - new AnnouncerModule(), -// new MetricsModule(), - new SegmentWriteOutMediumModule(), - new ServerModule(), - new StorageNodeModule(), - new JettyServerModule(), - new ExpressionModule(), - new NestedDataModule(), - new DiscoveryModule(), - new ServerViewModule(), - new MetadataConfigModule(), - new DerbyMetadataStorageDruidModule(), - new JacksonConfigManagerModule(), - new CoordinatorDiscoveryModule(), - new LocalDataStorageDruidModule(), - new TombstoneDataStorageModule(), - new FirehoseModule(), - new JavaScriptModule(), - new AuthenticatorModule(), - new AuthenticatorMapperModule(), - new EscalatorModule(), - new AuthorizerModule(), - new AuthorizerMapperModule(), - new StartupLoggingModule(), - new ExternalStorageAccessSecurityModule(), - new ServiceClientModule(), - new StorageConnectorModule() -); - } // builder.addModule(new StorageNodeModule()); @@ -644,6 +606,48 @@ public class Launcher } ); + if(true) { + builder.addModules( + new Log4jShutterDownerModule(), + new LifecycleModule(), +// ExtensionsModule.SecondaryModule.class, + new DruidAuthModule(), +// TLSCertificateCheckerModule.class, +// EmitterModule.class, + HttpClientModule.global(), + HttpClientModule.escalatedGlobal(), + new HttpClientModule("druid.broker.http", Client.class, true), + new HttpClientModule("druid.broker.http", EscalatedClient.class, true), + new CuratorModule(), + new AnnouncerModule(), +// new MetricsModule(), + new SegmentWriteOutMediumModule(), + new ServerModule(), + new StorageNodeModule(), + new JettyServerModule(), + new ExpressionModule(), + new NestedDataModule(), + new DiscoveryModule(), + new ServerViewModule(), + new MetadataConfigModule(), + new DerbyMetadataStorageDruidModule(), + new JacksonConfigManagerModule(), + new CoordinatorDiscoveryModule(), + new LocalDataStorageDruidModule(), + new TombstoneDataStorageModule(), + new FirehoseModule(), + new JavaScriptModule(), + new AuthenticatorModule(), +// new AuthenticatorMapperModule(), +// new EscalatorModule(), + new AuthorizerModule(), +// new AuthorizerMapperModule(), + new StartupLoggingModule(), + new ExternalStorageAccessSecurityModule(), + new ServiceClientModule(), + new StorageConnectorModule() +); + } } @Override diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/util/SqlTestFramework.java b/sql/src/test/java/org/apache/druid/sql/calcite/util/SqlTestFramework.java index dfd946a0b43..fc4df291d7e 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/util/SqlTestFramework.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/util/SqlTestFramework.java @@ -184,6 +184,10 @@ public class SqlTestFramework default void close() throws IOException { } + + default void configureGuice(CoreInjectorBuilder injectorBuilder, List overrideModules) { + configureGuice(injectorBuilder); + } } public interface PlannerComponentSupplier @@ -646,13 +650,15 @@ return componentSupplier.getPlannerComponentSupplier().createViewManager(); .addModule(new LookylooModule()) .addModule(new SegmentWranglerModule()) .addModule(new SqlAggregationModule()) - .addModule(new ExpressionModule()) - .addModule(testSetupModule()); + .addModule(new ExpressionModule()); +// .addModule(testSetupModule()); - builder.componentSupplier.configureGuice(injectorBuilder); + List overrideModules = new ArrayList<>(builder.overrideModules); + overrideModules.add(testSetupModule()); + builder.componentSupplier.configureGuice(injectorBuilder, overrideModules); ServiceInjectorBuilder serviceInjector = new ServiceInjectorBuilder(injectorBuilder); - serviceInjector.addAll(builder.overrideModules); + serviceInjector.addAll(overrideModules); this.injector = serviceInjector.build(); this.engine = builder.componentSupplier.createEngine(queryLifecycleFactory(), queryJsonMapper(), injector);