You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/10/20 08:19:24 UTC

[GitHub] [druid] AmatyaAvadhanula commented on a diff in pull request #13221: Remove skip ignorable shards

AmatyaAvadhanula commented on code in PR #13221:
URL: https://github.com/apache/druid/pull/13221#discussion_r1000295030


##########
extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:
##########
@@ -803,11 +805,21 @@ private Set<Shard> getShardsUsingListShards(String stream)
   public Set<String> getPartitionIds(String stream)
   {
     return wrapExceptions(() -> {
-      ImmutableSet.Builder<String> partitionIds = ImmutableSet.builder();
-      for (Shard shard : getShards(stream)) {
-        partitionIds.add(shard.getShardId());
+      final Set<String> retVal = new TreeSet<>();
+      ListShardsRequest request = new ListShardsRequest().withStreamName(stream);
+      while (true) {
+        ListShardsResult result = kinesis.listShards(request);
+        retVal.addAll(result.getShards()
+                            .stream()
+                            .map(Shard::getShardId)
+                            .collect(Collectors.toList())
+        );
+        String nextToken = result.getNextToken();
+        if (nextToken == null) {
+          return retVal;
+        }
+        request = new ListShardsRequest().withNextToken(nextToken);

Review Comment:
   Thanks for pointing it out. This is an error and would always use listShards to get partition Ids



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org