Skip to content

Commit

Permalink
[FLINK-36637] Fix ListShards for Kinesis streams with large number of…
Browse files Browse the repository at this point in the history
… shards
  • Loading branch information
elphastori committed Oct 31, 2024
1 parent b922a2d commit 6763f0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public List<Shard> listShards(String streamArn, ListShardsStartingPosition start
listShardsResponse =
kinesisClient.listShards(
ListShardsRequest.builder()
.streamARN(streamArn)
.streamARN(nextToken == null ? streamArn : null)
.shardFilter(
nextToken == null
? startingPosition.getShardFilter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ void testListShardsMultipleCalls() {
ListShardItem.builder()
.validation(
getListShardRequestValidation(
STREAM_ARN, null, "next-token-1"))
null, null, "next-token-1"))
.shards(expectedShards.subList(1, 2))
.nextToken("next-token-2")
.build(),
ListShardItem.builder()
.validation(
getListShardRequestValidation(
STREAM_ARN, null, "next-token-2"))
null, null, "next-token-2"))
.shards(expectedShards.subList(2, 4))
.nextToken(null)
.build())
Expand Down Expand Up @@ -461,6 +461,9 @@ private Consumer<ListShardsRequest> getListShardRequestValidation(
.nextToken(nextToken)
.build();
assertThat(req).isEqualTo(expectedReq);
if (nextToken != null) {
assertThat(streamArn).isNull();
}
};
}

Expand Down

0 comments on commit 6763f0a

Please sign in to comment.