From bc70443c7f1119061a486bc749fe1b29aac38d67 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Mon, 5 Aug 2024 13:20:13 +0000 Subject: [PATCH] update few more --- .../apache/druid/msq/exec/TestMSQSqlModule.java | 5 ++--- .../druid/msq/test/CalciteArraysQueryMSQTest.java | 14 +++----------- .../msq/test/CalciteNestedDataQueryMSQTest.java | 13 +++---------- .../druid/msq/test/CalciteSelectQueryMSQTest.java | 14 +++----------- .../druid/msq/test/CalciteUnionQueryMSQTest.java | 13 +++---------- 5 files changed, 14 insertions(+), 45 deletions(-) diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/TestMSQSqlModule.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/TestMSQSqlModule.java index 5e1edd554ad..2f5f3265d8c 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/TestMSQSqlModule.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/TestMSQSqlModule.java @@ -36,7 +36,7 @@ import org.apache.druid.sql.SqlToolbox; import org.apache.druid.sql.avatica.DruidMeta; import org.apache.druid.sql.avatica.MSQDruidMeta; -class TestMSQSqlModule extends TestDruidModule { +public class TestMSQSqlModule extends TestDruidModule { @Provides @MultiStageQuery @@ -82,8 +82,7 @@ class TestMSQSqlModule extends TestDruidModule { @LazySingleton private WorkerMemoryParameters makeWorkerMemoryParameters() { - final WorkerMemoryParameters workerMemoryParameters = MSQTestBase.makeTestWorkerMemoryParameters(); - return workerMemoryParameters; + return MSQTestBase.makeTestWorkerMemoryParameters(); } @Provides diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteArraysQueryMSQTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteArraysQueryMSQTest.java index 124b4fce258..90428f1353d 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteArraysQueryMSQTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteArraysQueryMSQTest.java @@ -20,11 +20,10 @@ package org.apache.druid.msq.test; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.collect.ImmutableList; import com.google.inject.Injector; import com.google.inject.Module; import org.apache.druid.guice.DruidInjectorBuilder; -import org.apache.druid.msq.exec.WorkerMemoryParameters; +import org.apache.druid.msq.exec.TestMSQSqlModule; import org.apache.druid.msq.sql.MSQTaskSqlEngine; import org.apache.druid.msq.test.CalciteArraysQueryMSQTest.ArraysQueryMSQComponentSupplier; import org.apache.druid.query.groupby.TestGroupByBuffers; @@ -55,6 +54,7 @@ public class CalciteArraysQueryMSQTest extends CalciteArraysQueryTest builder.addModules( CalciteMSQTestsHelper.fetchModules(tempDirProducer::newTempFolder, TestGroupByBuffers.createDefault()).toArray(new Module[0]) ); + builder.addModule(new TestMSQSqlModule()); } @Override @@ -64,15 +64,7 @@ public class CalciteArraysQueryMSQTest extends CalciteArraysQueryTest Injector injector ) { - final WorkerMemoryParameters workerMemoryParameters = MSQTestBase.makeTestWorkerMemoryParameters(); - final MSQTestOverlordServiceClient indexingServiceClient = new MSQTestOverlordServiceClient( - queryJsonMapper, - injector, - new MSQTestTaskActionClient(queryJsonMapper, injector), - workerMemoryParameters, - ImmutableList.of() - ); - return new MSQTaskSqlEngine(indexingServiceClient, queryJsonMapper); + return injector.getInstance(MSQTaskSqlEngine.class); } } diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteNestedDataQueryMSQTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteNestedDataQueryMSQTest.java index 5d4c0994ea0..0a2b8955a3d 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteNestedDataQueryMSQTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteNestedDataQueryMSQTest.java @@ -25,7 +25,7 @@ import com.google.inject.Injector; import com.google.inject.Module; import org.apache.druid.guice.DruidInjectorBuilder; import org.apache.druid.java.util.common.ISE; -import org.apache.druid.msq.exec.WorkerMemoryParameters; +import org.apache.druid.msq.exec.TestMSQSqlModule; import org.apache.druid.msq.sql.MSQTaskSqlEngine; import org.apache.druid.query.groupby.TestGroupByBuffers; import org.apache.druid.server.QueryLifecycleFactory; @@ -58,6 +58,7 @@ public class CalciteNestedDataQueryMSQTest extends CalciteNestedDataQueryTest builder.addModules( CalciteMSQTestsHelper.fetchModules(tempDirProducer::newTempFolder, TestGroupByBuffers.createDefault()).toArray(new Module[0]) ); + builder.addModule(new TestMSQSqlModule()); } @Override @@ -67,15 +68,7 @@ public class CalciteNestedDataQueryMSQTest extends CalciteNestedDataQueryTest Injector injector ) { - final WorkerMemoryParameters workerMemoryParameters = MSQTestBase.makeTestWorkerMemoryParameters(); - final MSQTestOverlordServiceClient indexingServiceClient = new MSQTestOverlordServiceClient( - queryJsonMapper, - injector, - new MSQTestTaskActionClient(queryJsonMapper, injector), - workerMemoryParameters, - ImmutableList.of() - ); - return new MSQTaskSqlEngine(indexingServiceClient, queryJsonMapper); + return injector.getInstance(MSQTaskSqlEngine.class); } } diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java index 2de9229b4ad..2039b2f2426 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteSelectQueryMSQTest.java @@ -27,7 +27,7 @@ import com.google.inject.Module; import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.DruidInjectorBuilder; import org.apache.druid.java.util.common.ISE; -import org.apache.druid.msq.exec.WorkerMemoryParameters; +import org.apache.druid.msq.exec.TestMSQSqlModule; import org.apache.druid.msq.sql.MSQTaskSqlEngine; import org.apache.druid.msq.test.CalciteSelectQueryMSQTest.SelectMSQComponentSupplier; import org.apache.druid.query.groupby.TestGroupByBuffers; @@ -63,9 +63,9 @@ public class CalciteSelectQueryMSQTest extends CalciteQueryTest { super.configureGuice(builder); builder.addModules(CalciteMSQTestsHelper.fetchModules(tempDirProducer::newTempFolder, TestGroupByBuffers.createDefault()).toArray(new Module[0])); + builder.addModule(new TestMSQSqlModule()); } - @Override public SqlEngine createEngine( QueryLifecycleFactory qlf, @@ -73,15 +73,7 @@ public class CalciteSelectQueryMSQTest extends CalciteQueryTest Injector injector ) { - final WorkerMemoryParameters workerMemoryParameters = MSQTestBase.makeTestWorkerMemoryParameters(); - final MSQTestOverlordServiceClient indexingServiceClient = new MSQTestOverlordServiceClient( - queryJsonMapper, - injector, - new MSQTestTaskActionClient(queryJsonMapper, injector), - workerMemoryParameters, - ImmutableList.of() - ); - return new MSQTaskSqlEngine(indexingServiceClient, queryJsonMapper); + return injector.getInstance(MSQTaskSqlEngine.class); } } diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteUnionQueryMSQTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteUnionQueryMSQTest.java index e4b678402a8..96760418d78 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteUnionQueryMSQTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteUnionQueryMSQTest.java @@ -26,7 +26,7 @@ import com.google.inject.Module; import org.apache.druid.common.config.NullHandling; import org.apache.druid.guice.DruidInjectorBuilder; import org.apache.druid.java.util.common.granularity.Granularities; -import org.apache.druid.msq.exec.WorkerMemoryParameters; +import org.apache.druid.msq.exec.TestMSQSqlModule; import org.apache.druid.msq.sql.MSQTaskSqlEngine; import org.apache.druid.query.QueryDataSource; import org.apache.druid.query.TableDataSource; @@ -70,6 +70,7 @@ public class CalciteUnionQueryMSQTest extends CalciteUnionQueryTest builder.addModules( CalciteMSQTestsHelper.fetchModules(tempDirProducer::newTempFolder, TestGroupByBuffers.createDefault()).toArray(new Module[0]) ); + builder.addModule(new TestMSQSqlModule()); } @Override @@ -79,15 +80,7 @@ public class CalciteUnionQueryMSQTest extends CalciteUnionQueryTest Injector injector ) { - final WorkerMemoryParameters workerMemoryParameters = MSQTestBase.makeTestWorkerMemoryParameters(); - final MSQTestOverlordServiceClient indexingServiceClient = new MSQTestOverlordServiceClient( - queryJsonMapper, - injector, - new MSQTestTaskActionClient(queryJsonMapper, injector), - workerMemoryParameters, - ImmutableList.of() - ); - return new MSQTaskSqlEngine(indexingServiceClient, queryJsonMapper); + return injector.getInstance(MSQTaskSqlEngine.class); } }