[
https://issues.apache.org/jira/browse/FLINK-4574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15849919#comment-15849919
]
ASF GitHub Bot commented on FLINK-4574:
---------------------------------------
Github user tony810430 commented on the issue:
https://github.com/apache/flink/pull/2925
Hi, @tzulitai
I think there is no better way if trying to use `Timer` to deal with `0`
fetch interval. Even though I implement my own `Timer` scheduler, it just move
the `runForever` inside from `ShardConsumerTask`. Because fetch interval is
`0`, there is no way to get the next expected execution time and the solution
would be running the function forever.
I think a better solution is defined non-positive fetch interval differs
from positive fetch interval and would be executed in another way in the
document. The implementation will be two parts: the original way remains the
same without `runForever` in `ShardConsumerFetcherTask` and the other is for
non-positive fetch interval implemented by using a Thread running
`ShardConsumerFetcherTask::run()` forever.
It is more reasonable for me to distinguish these two configuration and
implement them by using two ways in `ShardConsumer::run()`. What do you think?
> Strengthen fetch interval implementation in Kinesis consumer
> ------------------------------------------------------------
>
> Key: FLINK-4574
> URL: https://issues.apache.org/jira/browse/FLINK-4574
> Project: Flink
> Issue Type: Improvement
> Components: Kinesis Connector
> Affects Versions: 1.1.0
> Reporter: Tzu-Li (Gordon) Tai
> Assignee: Wei-Che Wei
>
> As pointed out by [~rmetzger], right now the fetch interval implementation in
> the {{ShardConsumer}} class of the Kinesis consumer can lead to much longer
> interval times than specified by the user, ex. say the specified fetch
> interval is {{f}}, it takes {{x}} to complete a {{getRecords()}} call, and
> {{y}} to complete processing the fetched records for emitting, than the
> actual interval between each fetch is actually {{f+x+y}}.
> The main problem with this is that we can never guarantee how much time has
> past since the last {{getRecords}} call, thus can not guarantee that returned
> shard iterators will not have expired the next time we use them, even if we
> limit the user-given value for {{f}} to not be longer than the iterator
> expire time.
> I propose to improve this by, per {{ShardConsumer}}, use a
> {{ScheduledExecutorService}} / {{Timer}} to do the fixed-interval fetching,
> and a separate blocking queue that collects the fetched records for emitting.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)