cecemei commented on code in PR #18950:
URL: https://github.com/apache/druid/pull/18950#discussion_r2767410543


##########
indexing-service/src/test/java/org/apache/druid/indexing/common/actions/TaskActionTestKit.java:
##########
@@ -66,7 +68,46 @@ public class TaskActionTestKit extends ExternalResource
   private BlockingExecutorService metadataCachePollExec;
 
   private boolean useSegmentMetadataCache = false;
+  private boolean useCentralizedDatasourceSchema = false;
+  private boolean batchSegmentAllocation = true;
   private boolean skipSegmentPayloadFetchForAllocation = new 
TaskLockConfig().isBatchAllocationReduceMetadataIO();
+  private AtomicBoolean configFinalized = new AtomicBoolean();
+
+  public TaskActionTestKit setUseSegmentMetadataCache(boolean 
useSegmentMetadataCache)
+  {
+    if (configFinalized.get()) {
+      throw new IllegalStateException("Test config already finalized");
+    }
+    this.useSegmentMetadataCache = useSegmentMetadataCache;
+    return this;
+  }
+
+  public TaskActionTestKit setUseCentralizedDatasourceSchema(boolean 
useCentralizedDatasourceSchema)
+  {
+    if (configFinalized.get()) {
+      throw new IllegalStateException("Test config already finalized");
+    }
+    this.useCentralizedDatasourceSchema = useCentralizedDatasourceSchema;
+    return this;
+  }
+
+  public TaskActionTestKit setBatchSegmentAllocation(boolean 
batchSegmentAllocation)

Review Comment:
   it's only for segment lock, and i wasn't sure it's due to test setup or 
anything. 



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/NativeCompactionTaskRunTest.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.indexing.common.task;
+
+import org.apache.druid.client.indexing.ClientCompactionTaskGranularitySpec;
+import org.apache.druid.indexing.common.LockGranularity;
+import org.apache.druid.java.util.common.granularity.Granularities;
+import org.apache.druid.java.util.common.granularity.Granularity;
+import org.joda.time.Interval;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+@RunWith(Parameterized.class)
+public class NativeCompactionTaskRunTest extends CompactionTaskRunBase
+{
+  @Parameterized.Parameters(name = "name={0}, inputInterval={5}, 
segmentGran={6}")
+  public static Iterable<Object[]> constructorFeeder()
+  {
+    final List<Object[]> constructors = new ArrayList<>();
+
+    for (LockGranularity lockGranularity : new 
LockGranularity[]{LockGranularity.TIME_CHUNK, LockGranularity.SEGMENT}) {
+      for (boolean useCentralizedDatasourceSchema : new boolean[]{true, 
false}) {
+        for (boolean useSegmentMetadataCache : new boolean[]{false, true}) {
+          for (boolean useConcurrentLocks : new boolean[]{false, true}) {
+            for (Interval inputInterval : new Interval[]{TEST_INTERVAL, 
TEST_INTERVAL_DAY}) {

Review Comment:
   this has been updated



##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:
##########
@@ -635,12 +640,7 @@ static Map<Interval, DataSchema> 
createDataSchemasForIntervals(
           toolbox.getEmitter(),
           metricBuilder,
           segmentProvider.dataSource,
-          JodaUtils.umbrellaInterval(

Review Comment:
   synced offline, the data schema & lock would use the umbrella interval of 
segments and input interval



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/actions/TaskActionTestKit.java:
##########
@@ -66,7 +68,46 @@ public class TaskActionTestKit extends ExternalResource
   private BlockingExecutorService metadataCachePollExec;
 
   private boolean useSegmentMetadataCache = false;
+  private boolean useCentralizedDatasourceSchema = false;
+  private boolean batchSegmentAllocation = true;
   private boolean skipSegmentPayloadFetchForAllocation = new 
TaskLockConfig().isBatchAllocationReduceMetadataIO();
+  private AtomicBoolean configFinalized = new AtomicBoolean();
+
+  public TaskActionTestKit setUseSegmentMetadataCache(boolean 
useSegmentMetadataCache)
+  {
+    if (configFinalized.get()) {
+      throw new IllegalStateException("Test config already finalized");
+    }
+    this.useSegmentMetadataCache = useSegmentMetadataCache;
+    return this;
+  }
+
+  public TaskActionTestKit setUseCentralizedDatasourceSchema(boolean 
useCentralizedDatasourceSchema)
+  {
+    if (configFinalized.get()) {
+      throw new IllegalStateException("Test config already finalized");
+    }
+    this.useCentralizedDatasourceSchema = useCentralizedDatasourceSchema;
+    return this;
+  }
+
+  public TaskActionTestKit setBatchSegmentAllocation(boolean 
batchSegmentAllocation)

Review Comment:
   yea so it's set to false in CompactionTaskRunBase



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to