suneet-s commented on a change in pull request #9274: Refactoring some codes 
around ingestion
URL: https://github.com/apache/druid/pull/9274#discussion_r374232121
 
 

 ##########
 File path: 
indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java
 ##########
 @@ -875,14 +876,36 @@ private TaskStatus generateAndPublishSegments(
       toolbox.getMonitorScheduler().addMonitor(metricsMonitor);
     }
 
+    final PartitionsSpec partitionsSpec = 
partitionAnalysis.getPartitionsSpec();
     final IndexTuningConfig tuningConfig = ingestionSchema.getTuningConfig();
     final long pushTimeout = tuningConfig.getPushTimeout();
 
-    final IndexTaskSegmentAllocator segmentAllocator = createSegmentAllocator(
-        toolbox,
-        dataSchema,
-        allocateSpec
-    );
+    final SegmentAllocator segmentAllocator;
+    final SequenceNameFunction sequenceNameFunction;
+    if (partitionsSpec.getType() == SecondaryPartitionType.LINEAR) {
+      segmentAllocator = SegmentAllocators.forLinearPartitioning(
+          toolbox,
+          null,
+          dataSchema,
+          getTaskLockHelper(),
+          ingestionSchema.getIOConfig().isAppendToExisting(),
+          partitionAnalysis.getPartitionsSpec()
+      );
+      sequenceNameFunction = new 
LinearlyPartitionedSequenceNameFunction(getId());
+    } else {
 
 Review comment:
   I think it's better to be explicit here about which types we expect to be 
non linear and throw a `UOE` exception if there another type is added. This 
forces the dev who adds a new type to think about which category it should fall 
in to.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to