Details
-
Improvement
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
Description
The current model implemented by the FutureNotifier and the SourceReaderBase has a shortcoming:
- It does not support availability notifications where the notification comes before the check. IN that case the notification is lost.
- One can see the added complexity created by this model also in the SourceReaderBase#isAvailable() where the returned future needs to be "post-processed" and eagerly completed if the reader is in fact available. This is based on queue size, which makes it hard to have other conditions.
I think we can do something that is both easier and a bit more efficient by following a similar model as the org.apache.flink.runtime.io.AvailabilityProvider.AvailabilityHelper.
Furthermore, I believe we can win more efficiency by integrating this better with the FutureCompletingBlockingQueue.
I suggest to do a similar implementation as the AvailabilityHelper directly in the FutureCompletingBlockingQueue.