CrynetLogistics commented on a change in pull request #17244:
URL: https://github.com/apache/flink/pull/17244#discussion_r707549043
##########
File path:
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/writer/AsyncSinkWriter.java
##########
@@ -139,21 +171,40 @@ public AsyncSinkWriter(
this.maxBatchSize = maxBatchSize;
this.maxInFlightRequests = maxInFlightRequests;
this.maxBufferedRequests = maxBufferedRequests;
+ this.flushOnBufferSizeMB = flushOnBufferSizeMB;
+ this.maxTimeInBufferMS = maxTimeInBufferMS;
+
+ this.inFlightRequestsCount = 0;
+ this.bufferedRequestEntriesTotalSizeMB = 0;
+ }
+
+ private void registerCallback() {
+ Sink.ProcessingTimeService.ProcessingTimeCallback ptc =
+ instant -> {
Review comment:
This is always executed in the mailbox thread.
`StreamTask` creates the `ProcessingTimeService` and there is a method that
defers the callback to the mailbox, which is provided to
`ProcessingTimeService` at construction time.
```
ProcessingTimeCallback deferCallbackToMailbox(
MailboxExecutor mailboxExecutor, ProcessingTimeCallback callback) {
return timestamp -> {
mailboxExecutor.execute(
() -> invokeProcessingTimeCallback(callback, timestamp),
"Timer callback for %s @ %d",
callback,
timestamp);
};
}
```
--
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]