This is an automated email from the ASF dual-hosted git repository.

FrankChen021 pushed a commit to branch codex/native-compaction-test-matrix
in repository https://gitbox.apache.org/repos/asf/druid.git

commit 3d3d75b5f24c8836f9682579b700fea91ab5cb17
Author: Frank Chen <[email protected]>
AuthorDate: Wed Sep 9 15:12:58 2026 +0800

    test: preserve immutable compaction fixtures
---
 .../common/task/CompactionTaskRunBase.java         | 51 ++++++++++++----------
 1 file changed, 28 insertions(+), 23 deletions(-)

diff --git 
a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/CompactionTaskRunBase.java
 
b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/CompactionTaskRunBase.java
index 675dfe334ee..0dd75490829 100644
--- 
a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/CompactionTaskRunBase.java
+++ 
b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/CompactionTaskRunBase.java
@@ -199,16 +199,16 @@ public abstract class CompactionTaskRunBase
   protected ObjectMapper objectMapper;
   protected File reportsFile;
 
-  protected OverlordClient overlordClient;
-  protected CoordinatorClient coordinatorClient;
-  protected SegmentCacheManagerFactory segmentCacheManagerFactory;
+  protected final OverlordClient overlordClient;
+  protected final CoordinatorClient coordinatorClient;
+  protected final SegmentCacheManagerFactory segmentCacheManagerFactory;
 
   protected LockGranularity lockGranularity;
   protected boolean useCentralizedDatasourceSchema;
   protected boolean useConcurrentLocks;
   protected Interval inputInterval;
   protected Granularity segmentGranularity;
-  protected TestUtils testUtils;
+  protected final TestUtils testUtils;
 
   protected ExecutorService exec;
   protected File localDeepStorage;
@@ -217,27 +217,13 @@ public abstract class CompactionTaskRunBase
   private boolean baseSetupStarted;
   private boolean runnerSetupStarted;
 
-  private void configure(Configuration configuration)
+  protected CompactionTaskRunBase()
   {
-    lockGranularity = configuration.getLockGranularity();
-    useCentralizedDatasourceSchema = 
configuration.isUseCentralizedDatasourceSchema();
-    useConcurrentLocks = configuration.isUseConcurrentLocks();
-    inputInterval = configuration.getInputInterval();
-    segmentGranularity = configuration.getSegmentGranularity();
-
-    taskActionTestKit = new TaskActionTestKit()
-        .setUseCentralizedDatasourceSchema(useCentralizedDatasourceSchema)
-        .setUseSegmentMetadataCache(configuration.isUseSegmentMetadataCache())
-        .setBatchSegmentAllocation(configuration.isBatchSegmentAllocation());
-
     testUtils = new TestUtils();
-    segmentCacheManagerFactory = 
SegmentCacheManagerFactory.createWithOwnedPool(TestIndex.INDEX_IO, 
testUtils.getTestObjectMapper());
-
-    objectMapper = testUtils.getTestObjectMapper();
-    objectMapper.registerSubtypes(new NamedType(LocalLoadSpec.class, "local"));
-    objectMapper.registerSubtypes(LocalDataSegmentPuller.class);
-    objectMapper.registerSubtypes(TombstoneLoadSpec.class);
-
+    segmentCacheManagerFactory = 
SegmentCacheManagerFactory.createWithOwnedPool(
+        TestIndex.INDEX_IO,
+        testUtils.getTestObjectMapper()
+    );
     overlordClient = new NoopOverlordClient();
     coordinatorClient = new NoopCoordinatorClient()
     {
@@ -276,6 +262,25 @@ public abstract class CompactionTaskRunBase
     };
   }
 
+  private void configure(Configuration configuration)
+  {
+    lockGranularity = configuration.getLockGranularity();
+    useCentralizedDatasourceSchema = 
configuration.isUseCentralizedDatasourceSchema();
+    useConcurrentLocks = configuration.isUseConcurrentLocks();
+    inputInterval = configuration.getInputInterval();
+    segmentGranularity = configuration.getSegmentGranularity();
+
+    taskActionTestKit = new TaskActionTestKit()
+        .setUseCentralizedDatasourceSchema(useCentralizedDatasourceSchema)
+        .setUseSegmentMetadataCache(configuration.isUseSegmentMetadataCache())
+        .setBatchSegmentAllocation(configuration.isBatchSegmentAllocation());
+
+    objectMapper = testUtils.getTestObjectMapper();
+    objectMapper.registerSubtypes(new NamedType(LocalLoadSpec.class, "local"));
+    objectMapper.registerSubtypes(LocalDataSegmentPuller.class);
+    objectMapper.registerSubtypes(TombstoneLoadSpec.class);
+  }
+
   protected final void startCase(Configuration configuration) throws Exception
   {
     taskActionTestKitStarted = false;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to