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