StephanEwen commented on a change in pull request #13385:
URL: https://github.com/apache/flink/pull/13385#discussion_r488606245
##########
File path:
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/reader/synchronization/FutureCompletingBlockingQueue.java
##########
@@ -275,4 +340,22 @@ private void setWakeUp(boolean value) {
wakeUp = value;
}
}
+
+ //
------------------------------------------------------------------------
+ // utilities
+ //
------------------------------------------------------------------------
+
+ @SuppressWarnings("unchecked")
+ private static CompletableFuture<Void> getAvailableFuture() {
Review comment:
I would like to keep this. It does not add a hard dependency, it is a
best-effort optimization.
This future will in the end be passed all the way to the main mailbox. There
it helps to short circuit certain conditions, eliding volatile memory accesses.
That is a good optimization, in my opinion. Any volatile memory access we can
eliminate on the per-record paths tend to be worth it. They make the single
thread faster but also reduce stress on cache coherency protocol, etc.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]