From 33cb563ff9d5da298f3aefcbeddeff9fc5c00f84 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Sun, 15 Sep 2024 23:03:26 -0700 Subject: [PATCH] Move TerminalStageSpecFactory packages. (#17049) * Move TerminalStageSpecFactory packages. These packages are moved from the "guice" package to the "indexing.destination" package. They make more sense here, since "guice" is reserved for Guice modules, annotations, and providers. * Rearrange imports. --- .../main/java/org/apache/druid/msq/guice/MSQSqlModule.java | 2 ++ .../destination}/MSQTerminalStageSpecFactory.java | 3 +-- .../SegmentGenerationTerminalStageSpecFactory.java | 4 +--- .../main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java | 2 +- .../main/java/org/apache/druid/msq/sql/MSQTaskSqlEngine.java | 2 +- .../test/java/org/apache/druid/msq/exec/TestMSQSqlModule.java | 2 +- .../src/test/java/org/apache/druid/msq/test/MSQTestBase.java | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) rename extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/{guice => indexing/destination}/MSQTerminalStageSpecFactory.java (91%) rename extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/{guice => indexing/destination}/SegmentGenerationTerminalStageSpecFactory.java (87%) diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/guice/MSQSqlModule.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/guice/MSQSqlModule.java index 5d837940e19..b7239980d52 100644 --- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/guice/MSQSqlModule.java +++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/guice/MSQSqlModule.java @@ -27,6 +27,8 @@ import org.apache.druid.guice.LazySingleton; import org.apache.druid.guice.annotations.LoadScope; import org.apache.druid.initialization.DruidModule; import org.apache.druid.metadata.input.InputSourceModule; +import org.apache.druid.msq.indexing.destination.MSQTerminalStageSpecFactory; +import org.apache.druid.msq.indexing.destination.SegmentGenerationTerminalStageSpecFactory; import org.apache.druid.msq.sql.MSQTaskSqlEngine; import org.apache.druid.sql.SqlStatementFactory; import org.apache.druid.sql.SqlToolbox; diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/guice/MSQTerminalStageSpecFactory.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/MSQTerminalStageSpecFactory.java similarity index 91% rename from extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/guice/MSQTerminalStageSpecFactory.java rename to extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/MSQTerminalStageSpecFactory.java index d5a1bd79455..d7179f13225 100644 --- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/guice/MSQTerminalStageSpecFactory.java +++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/MSQTerminalStageSpecFactory.java @@ -17,9 +17,8 @@ * under the License. */ -package org.apache.druid.msq.guice; +package org.apache.druid.msq.indexing.destination; -import org.apache.druid.msq.indexing.destination.TerminalStageSpec; import org.apache.druid.sql.calcite.planner.PlannerContext; import org.apache.druid.sql.calcite.rel.DruidQuery; diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/guice/SegmentGenerationTerminalStageSpecFactory.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/SegmentGenerationTerminalStageSpecFactory.java similarity index 87% rename from extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/guice/SegmentGenerationTerminalStageSpecFactory.java rename to extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/SegmentGenerationTerminalStageSpecFactory.java index f761c0616a6..09c3c514ec0 100644 --- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/guice/SegmentGenerationTerminalStageSpecFactory.java +++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/destination/SegmentGenerationTerminalStageSpecFactory.java @@ -17,10 +17,8 @@ * under the License. */ -package org.apache.druid.msq.guice; +package org.apache.druid.msq.indexing.destination; -import org.apache.druid.msq.indexing.destination.SegmentGenerationStageSpec; -import org.apache.druid.msq.indexing.destination.TerminalStageSpec; import org.apache.druid.sql.calcite.planner.PlannerContext; import org.apache.druid.sql.calcite.rel.DruidQuery; diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java index 830fb87e1b2..ae667a7a558 100644 --- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java +++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java @@ -33,7 +33,6 @@ import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularity; import org.apache.druid.java.util.common.guava.Sequences; import org.apache.druid.msq.exec.MSQTasks; -import org.apache.druid.msq.guice.MSQTerminalStageSpecFactory; import org.apache.druid.msq.indexing.MSQControllerTask; import org.apache.druid.msq.indexing.MSQSpec; import org.apache.druid.msq.indexing.MSQTuningConfig; @@ -42,6 +41,7 @@ import org.apache.druid.msq.indexing.destination.DurableStorageMSQDestination; import org.apache.druid.msq.indexing.destination.ExportMSQDestination; import org.apache.druid.msq.indexing.destination.MSQDestination; import org.apache.druid.msq.indexing.destination.MSQSelectDestination; +import org.apache.druid.msq.indexing.destination.MSQTerminalStageSpecFactory; import org.apache.druid.msq.indexing.destination.TaskReportMSQDestination; import org.apache.druid.msq.util.MSQTaskQueryMakerUtils; import org.apache.druid.msq.util.MultiStageQueryContext; diff --git a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskSqlEngine.java b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskSqlEngine.java index 9e07a909f4e..bdebe32a16f 100644 --- a/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskSqlEngine.java +++ b/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskSqlEngine.java @@ -42,7 +42,7 @@ import org.apache.druid.error.InvalidSqlInput; import org.apache.druid.java.util.common.StringUtils; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.java.util.common.granularity.Granularity; -import org.apache.druid.msq.guice.MSQTerminalStageSpecFactory; +import org.apache.druid.msq.indexing.destination.MSQTerminalStageSpecFactory; import org.apache.druid.msq.querykit.QueryKitUtils; import org.apache.druid.msq.util.ArrayIngestMode; import org.apache.druid.msq.util.DimensionSchemaUtils; 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 5bf4bbd44dc..0b48d2904dd 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 @@ -26,7 +26,7 @@ import com.google.inject.Provides; import org.apache.druid.guice.LazySingleton; import org.apache.druid.initialization.ServerInjectorBuilderTest.TestDruidModule; import org.apache.druid.msq.guice.MultiStageQuery; -import org.apache.druid.msq.guice.SegmentGenerationTerminalStageSpecFactory; +import org.apache.druid.msq.indexing.destination.SegmentGenerationTerminalStageSpecFactory; import org.apache.druid.msq.sql.MSQTaskSqlEngine; import org.apache.druid.msq.test.MSQTestBase; import org.apache.druid.msq.test.MSQTestOverlordServiceClient; diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/MSQTestBase.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/MSQTestBase.java index be05a0fcc8a..e5e3ba68e44 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/MSQTestBase.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/MSQTestBase.java @@ -92,12 +92,12 @@ import org.apache.druid.msq.guice.MSQExternalDataSourceModule; import org.apache.druid.msq.guice.MSQIndexingModule; import org.apache.druid.msq.guice.MSQSqlModule; import org.apache.druid.msq.guice.MultiStageQuery; -import org.apache.druid.msq.guice.SegmentGenerationTerminalStageSpecFactory; import org.apache.druid.msq.indexing.InputChannelFactory; import org.apache.druid.msq.indexing.MSQControllerTask; import org.apache.druid.msq.indexing.MSQSpec; import org.apache.druid.msq.indexing.MSQTuningConfig; import org.apache.druid.msq.indexing.destination.DataSourceMSQDestination; +import org.apache.druid.msq.indexing.destination.SegmentGenerationTerminalStageSpecFactory; import org.apache.druid.msq.indexing.destination.TaskReportMSQDestination; import org.apache.druid.msq.indexing.error.InsertLockPreemptedFaultTest; import org.apache.druid.msq.indexing.error.MSQErrorReport;