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/01/17 07:26:00 UTC

[GitHub] [druid] AmatyaAvadhanula commented on a change in pull request #12161: Mitigate Kinesis stream LimitExceededException by using listShards API

AmatyaAvadhanula commented on a change in pull request #12161:
URL: https://github.com/apache/druid/pull/12161#discussion_r785694779



##########
File path: extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java
##########
@@ -669,25 +666,12 @@ public String getEarliestSequenceNumber(StreamPartition<String> partition)
     return wrapExceptions(
         () -> {
           final Set<String> retVal = new HashSet<>();
-          DescribeStreamRequest request = new DescribeStreamRequest();
+          ListShardsRequest request = new ListShardsRequest();
           request.setStreamName(stream);
-
-          while (request != null) {
-            final DescribeStreamResult result = kinesis.describeStream(request);
-            final StreamDescription streamDescription = result.getStreamDescription();
-            final List<Shard> shards = streamDescription.getShards();
-
-            for (Shard shard : shards) {
-              retVal.add(shard.getShardId());
-            }
-
-            if (streamDescription.isHasMoreShards()) {
-              request.setExclusiveStartShardId(Iterables.getLast(shards).getShardId());
-            } else {
-              request = null;
-            }
+          List<Shard> shards = kinesis.listShards(request).getShards();

Review comment:
       Thanks for the scrutiny. It does seem like there is a limit of 1k (despite over 1100 shards being returned during my local testing).
   I'll make the changes




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