You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[FLINK-37298] Added Pluggable Components for BatchStrategy & BufferWrapper in AsyncSinkWriter. (#26274)
* [FLINK-37298] Add custom batch handling in AsyncSinkWriter.
* License added for new files.
* Review Comments Incorporated
* Corrected comments based on review.
* Comment correction
* Spotless check done
* Review comments incorporated for async custom batch
- Minor fixes based on reviewer feedback
- Cleaned up naming, comments, and Javadoc
* Removed Builder Pattern and corrected Test case.
* Marked Deque constructor as deprecated.
Copy file name to clipboardExpand all lines: flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/writer/AsyncSinkWriter.java
+56-52
Original file line number
Diff line number
Diff line change
@@ -33,11 +33,8 @@
33
33
34
34
importjava.io.IOException;
35
35
importjava.io.Serializable;
36
-
importjava.util.ArrayDeque;
37
-
importjava.util.ArrayList;
38
36
importjava.util.Collection;
39
37
importjava.util.Collections;
40
-
importjava.util.Deque;
41
38
importjava.util.List;
42
39
importjava.util.ListIterator;
43
40
importjava.util.concurrent.ScheduledFuture;
@@ -83,7 +80,16 @@ public abstract class AsyncSinkWriter<InputT, RequestEntryT extends Serializable
83
80
84
81
privatefinalintmaxBatchSize;
85
82
privatefinalintmaxBufferedRequests;
86
-
privatefinallongmaxBatchSizeInBytes;
83
+
84
+
/**
85
+
* Threshold in bytes to trigger a flush from the buffer.
86
+
*
87
+
* <p>This is derived from {@code maxBatchSizeInBytes} in the configuration, but is only used
88
+
* here to decide when the buffer should be flushed. The actual batch size limit is now enforced
89
+
* by the {@link BatchCreator}.
90
+
*/
91
+
privatefinallongflushThresholdBytes;
92
+
87
93
privatefinallongmaxTimeInBufferMS;
88
94
privatefinallongmaxRecordSizeInBytes;
89
95
@@ -112,8 +118,14 @@ public abstract class AsyncSinkWriter<InputT, RequestEntryT extends Serializable
112
118
* construct a new (retry) request entry from the response and add that back to the queue for
Copy file name to clipboardExpand all lines: flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/writer/BufferedRequestState.java
+6
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ public class BufferedRequestState<RequestEntryT extends Serializable> implements
0 commit comments