bube opened a new pull request, #254:
URL: https://github.com/apache/flink-connector-aws/pull/254

   <!--
   *Thank you for contributing to Apache Flink AWS Connectors - we are happy 
that you want to help us improve our Flink connectors. To help the community 
review your contribution in the best possible way, please go through the 
checklist below, which will get the contribution into a shape in which it can 
be best reviewed.*
   
   ## Contribution Checklist
   
   - The name of the pull request should correspond to a [JIRA 
issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are 
made for typos in JavaDoc or documentation files, which need no JIRA issue.
   - Commits should be in the form of "[FLINK-XXXX][component] Title of the 
pull request", where [FLINK-XXXX] should be replaced by the actual issue 
number. 
       Generally, [component] should be the connector you are working on.
       For example: "[FLINK-XXXX][Connectors/Kinesis] XXXX" if you are working 
on the Kinesis connector or "[FLINK-XXXX][Connectors/AWS] XXXX" if you are 
working on components shared among all the connectors.
   - Each pull request should only have one JIRA issue.
   - Once all items of the checklist are addressed, remove the above text and 
this checklist, leaving only the filled out template below.
   -->
   
   ## Purpose of the change
   
   Kinesis allows 5 `GetRecords` calls per second per shard. A source that 
fetches at every opportunity can eat most of that quota, causing other 
consumers of the same shard to fail with 
`ProvisionedThroughputExceededException`.
   
   This adds `source.reader.nonempty-records-fetch-interval` to throttle the 
reader after a fetch that *returned* records — the counterpart to the existing 
`source.reader.empty-records-fetch-interval`. It is applied per shard.
   
   Defaults to `0 ms`, preserving today's fetch-at-first-opportunity behaviour. 
Changing the default here would silently throttle existing users.
   
   ## Brief change log
   
   - Add `READER_NON_EMPTY_RECORDS_FETCH_INTERVAL`, default `0 ms`.
   - `KinesisShardSplitReaderBase` schedules the next fetch after a non-empty 
batch when the interval is set.
   - Document both reader interval options in the SQL connector table. The 
existing `empty-records-fetch-interval` was undocumented and its description 
said "in milliseconds" for a `Duration`.
   
   ## Verifying this change
   
   Added to `KinesisShardSplitReaderBaseTest`:
   
   - `testGetRecordsIntervalForNonEmptySource`: a configured interval is 
respected.
   - `testNoGetRecordsIntervalForNonEmptySourceByDefault`: unset preserves 
current behavior.
   
   Also verified by hand against localstack on a MiniCluster.
   
   ## Significant changes
   *(Please check any boxes [x] if the answer is "yes". You can first publish 
the PR and check them afterwards, for convenience.)*
   - [ ] Dependencies have been added or upgraded
   - [ ] Public API has been changed (Public API is any class annotated with 
`@Public(Evolving)`)
   - [ ] Serializers have been changed
   - [x] New feature has been introduced
     - If yes, how is this documented? (not applicable / docs / JavaDocs / not 
documented)
       - Configuration key descriptions added/updated
       - Added to Table docs, including missing `empty-records-fetch-interval`
     
   ## Use of AI assistance
   
   I wrote the implementation. AI assistance (Claude Code 2.1.233) was used to 
review it and apply the review outcome. The `Duration.ZERO` default in place of 
a nullable `Long`, the backwards-compatibility test, and the docs. Both commits 
carry a `Generated-by:` trailer per [ASF 
policy](https://www.apache.org/legal/generative-tooling.html). I have reviewed
   everything and verified it locally.


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

Reply via email to