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:00:39 UTC

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

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



##########
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:
       doubt : is this call paginated? (since the original API call is paginated with 1k shards). and also the `ListShardResult` also contains a nextToken. If it is paginated, I think we should get all the results




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