abhishekagarwal87 commented on code in PR #14424:
URL: https://github.com/apache/druid/pull/14424#discussion_r1284347236


##########
extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java:
##########
@@ -126,19 +126,20 @@ public KafkaSupervisor(
 
 
   @Override
-  protected RecordSupplier<Integer, Long, KafkaRecordEntity> 
setupRecordSupplier()
+  protected RecordSupplier<KafkaTopicPartition, Long, KafkaRecordEntity> 
setupRecordSupplier()
   {
     return new KafkaRecordSupplier(
         spec.getIoConfig().getConsumerProperties(),
         sortingMapper,
-        spec.getIoConfig().getConfigOverrides()
+        spec.getIoConfig().getConfigOverrides(),
+        spec.getIoConfig().isMultiTopic()
     );
   }
 
   @Override
-  protected int getTaskGroupIdForPartition(Integer partitionId)
+  protected int getTaskGroupIdForPartition(KafkaTopicPartition partitionId)
   {
-    return partitionId % spec.getIoConfig().getTaskCount();
+    return partitionId.partition() % spec.getIoConfig().getTaskCount();

Review Comment:
   Wow. Nice catch. I am wary of that logic as I don't want the assignment to 
change if someone adds one more topic to the stream. I am thinking something 
like below 
   `(31*topic.hashCode() + partition) % taskCount. ` but that may not lead to 
an optimal assignment. 



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