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