davidradl commented on code in PR #27134:
URL: https://github.com/apache/flink/pull/27134#discussion_r2472407604
##########
flink-core/src/main/java/org/apache/flink/api/connector/source/util/ratelimit/RateLimiter.java:
##########
@@ -27,14 +27,25 @@
/** The interface to rate limit execution of methods. */
@NotThreadSafe
@Experimental
-public interface RateLimiter {
+public interface RateLimiter<S> {
/**
* Returns a future that is completed once another event would not exceed
the rate limit. For
* correct functioning, the next invocation of this method should only
happen after the
* previously returned future has been completed.
*/
- CompletionStage<Void> acquire();
+ default CompletionStage<Void> acquire() {
+ return acquire(1);
+ }
+
+ /**
+ * Returns a future that is completed once another event would not exceed
the rate limit. For
+ * correct functioning, the next invocation of this method should only
happen after the
+ * previously returned future has been completed.
+ *
+ * @param requestSize The size of requests.
+ */
+ CompletionStage<Void> acquire(int requestSize);
Review Comment:
is it worth setting the default as the no-op implementation
--
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]