ccaominh commented on a change in pull request #9274: Refactoring some codes 
around ingestion
URL: https://github.com/apache/druid/pull/9274#discussion_r372148968
 
 

 ##########
 File path: 
indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java
 ##########
 @@ -659,50 +688,49 @@ public TaskStatus runTask(final TaskToolbox toolbox)
         inputSource,
         tmpDir,
         granularitySpec,
-        nonNullPartitionsSpec,
+        partitionsSpec,
         determineIntervals
     );
-
-    final Map<Interval, Pair<ShardSpecFactory, Integer>> allocateSpecs = new 
HashMap<>();
+    final PartitionAnalysis<Integer, ?> partitionAnalysis;
+    if (partitionsSpec.getType() == SecondaryPartitionType.LINEAR) {
+      partitionAnalysis = new LinearPartitionAnalysis((DynamicPartitionsSpec) 
partitionsSpec);
+    } else if (partitionsSpec.getType() == SecondaryPartitionType.HASH) {
+      partitionAnalysis = new HashPartitionAnalysis((HashedPartitionsSpec) 
partitionsSpec);
+    } else {
+      throw new UOE("%s", partitionsSpec.getClass().getName());
+    }
 
 Review comment:
   What do you think about adding a method to the partition spec interface so 
that future addition of partition specs do not potentially require modification 
to this code?

----------------------------------------------------------------
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