clintropolis commented on a change in pull request #8870: Additional Kinesis 
resharding fixes
URL: https://github.com/apache/incubator-druid/pull/8870#discussion_r351526835
 
 

 ##########
 File path: 
extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/supervisor/KinesisSupervisor.java
 ##########
 @@ -232,39 +231,34 @@ protected void 
scheduleReporting(ScheduledExecutorService reportingExec)
   @Override
   protected int getTaskGroupIdForPartition(String partitionId)
   {
-    if (!partitionIds.contains(partitionId)) {
-      partitionIds.add(partitionId);
-    }
-
     return getTaskGroupIdForPartitionWithProvidedList(partitionId, 
partitionIds);
   }
 
   private int getTaskGroupIdForPartitionWithProvidedList(String partitionId, 
List<String> availablePartitions)
   {
+    int index = availablePartitions.indexOf(partitionId);
+    if (index < 0) {
+      return index;
+    }
     return availablePartitions.indexOf(partitionId) % 
spec.getIoConfig().getTaskCount();
   }
 
   @Override
-  protected Map<Integer, ConcurrentHashMap<String, String>> 
recomputePartitionGroupsForExpiration(
+  protected Map<Integer, Set<String>> recomputePartitionGroupsForExpiration(
 
 Review comment:
   super nit: i think this fits on one line now. Unrelated i also see an unused 
static hash function from previous attempts at fixing all the holes in this 
sharding stuff..

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