jihoonson commented on a change in pull request #6095: Add support 
'keepSegmentGranularity' for compactionTask
URL: https://github.com/apache/incubator-druid/pull/6095#discussion_r208425648
 
 

 ##########
 File path: 
indexing-service/src/main/java/io/druid/indexing/common/task/CompactionTask.java
 ##########
 @@ -205,38 +216,46 @@ public boolean isReady(TaskActionClient 
taskActionClient) throws Exception
   @Override
   public TaskStatus run(final TaskToolbox toolbox) throws Exception
   {
-    if (indexTaskSpec == null) {
-      final IndexIngestionSpec ingestionSpec = createIngestionSchema(
+    if (indexTaskSpecs == null) {
+      indexTaskSpecs = createIngestionSchema(
           toolbox,
           segmentProvider,
           dimensionsSpec,
+          keepSegmentGranularity,
           tuningConfig,
           jsonMapper
-      );
-
-      if (ingestionSpec != null) {
-        indexTaskSpec = new IndexTask(
-            getId(),
-            getGroupId(),
-            getTaskResource(),
-            getDataSource(),
-            ingestionSpec,
-            getContext(),
-            authorizerMapper,
-            chatHandlerProvider,
-            rowIngestionMetersFactory
-        );
-      }
+      ).stream()
+      .map(spec -> new IndexTask(
+          getId(),
+          getGroupId(),
+          getTaskResource(),
+          getDataSource(),
+          spec,
+          getContext(),
+          authorizerMapper,
+          chatHandlerProvider,
+          rowIngestionMetersFactory
+      ))
+      .collect(Collectors.toList());
     }
 
-    if (indexTaskSpec == null) {
+    if (indexTaskSpecs.isEmpty()) {
       log.warn("Interval[%s] has no segments, nothing to do.", interval);
       return TaskStatus.failure(getId());
     } else {
-      final String json = 
jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(indexTaskSpec);
-      log.info("Generated compaction task details: " + json);
+      log.info("Generated [%d] compaction task specs: ", 
indexTaskSpecs.size());
 
 Review comment:
   Done.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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