ccaominh commented on a change in pull request #8925: Parallel indexing single 
dim partitions
URL: https://github.com/apache/incubator-druid/pull/8925#discussion_r354665283
 
 

 ##########
 File path: 
indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java
 ##########
 @@ -316,12 +355,49 @@ PartialHashSegmentMergeParallelIndexTaskRunner 
createPartialHashSegmentMergeRunn
     );
   }
 
+  @VisibleForTesting
+  PartialGenericSegmentMergeParallelIndexTaskRunner 
createPartialGenericSegmentMergeRunner(
+      TaskToolbox toolbox,
+      List<PartialGenericSegmentMergeIOConfig> ioConfigs
+  )
+  {
+    return new PartialGenericSegmentMergeParallelIndexTaskRunner(
+        toolbox,
+        getId(),
+        getGroupId(),
+        getIngestionSchema().getDataSchema(),
+        ioConfigs,
+        getIngestionSchema().getTuningConfig(),
+        getContext(),
+        indexingServiceClient
+    );
+  }
+
   @Override
   public boolean isReady(TaskActionClient taskActionClient) throws Exception
   {
+    if (useRangePartitions()) {
+      assertDataSketchesAvailable();
+    }
     return determineLockGranularityAndTryLock(taskActionClient, 
ingestionSchema.getDataSchema().getGranularitySpec());
   }
 
+  private boolean useRangePartitions()
+  {
+    return 
(ingestionSchema.getTuningConfig().getGivenOrDefaultPartitionsSpec() instanceof 
SingleDimensionPartitionsSpec);
+  }
+
+  private static void assertDataSketchesAvailable()
+  {
+    try {
+      //noinspection ResultOfObjectAllocationIgnored
+      new StringSketch();
+    }
+    catch (NoClassDefFoundError e) {
+      throw new ISE(e, "DataSketches is unvailable. Try adding the 
druid-datasketches extension to the classpath.");
 
 Review comment:
   Adjusted the wording in the error message

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to