CrynetLogistics commented on a change in pull request #17687:
URL: https://github.com/apache/flink/pull/17687#discussion_r744893445



##########
File path: 
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/writer/AsyncSinkWriter.java
##########
@@ -219,25 +278,38 @@ private void flush() {
         List<RequestEntryT> batch = new ArrayList<>(maxBatchSize);
 
         int batchSize = Math.min(maxBatchSize, bufferedRequestEntries.size());
+        int batchSizeBytes = 0;
         for (int i = 0; i < batchSize; i++) {
             RequestEntryWrapper<RequestEntryT> elem = 
bufferedRequestEntries.remove();
             batch.add(elem.getRequestEntry());
             bufferedRequestEntriesTotalSizeInBytes -= elem.getSize();
+            batchSizeBytes += elem.getSize();
         }
 
         if (batch.size() == 0) {
             return;
         }
 
+        long timestampOfRequest = System.currentTimeMillis();
         Consumer<Collection<RequestEntryT>> requestResult =
                 failedRequestEntries ->
                         mailboxExecutor.execute(
-                                () -> completeRequest(failedRequestEntries),
+                                () -> completeRequest(failedRequestEntries, 
timestampOfRequest),
                                 "Mark in-flight request as completed and 
requeue %d request entries",
                                 failedRequestEntries.size());
 
+        Consumer<Exception> fatalExceptionCons =

Review comment:
       Ah nice, that's even cooler.




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