cshuo commented on code in PR #20189:
URL: https://github.com/apache/hudi/pull/20189#discussion_r4225921206
##########
hudi-common/src/main/java/org/apache/hudi/common/util/RateLimiter.java:
##########
@@ -68,27 +94,59 @@ public boolean tryAcquire(int numPermits) {
}
public boolean acquire(int numOps) {
+ ValidationUtils.checkArgument(numOps > 0 && numOps <= maxPermits,
Review Comment:
Since both Flink callers invoke `acquire(1)` for every record, could we add
a no-argument `acquire()` that skips argument validation? Construction already
guarantees `maxPermits > 0`, so a single-permit request is always valid. We can
keep the checks in `acquire(int)` for variable-sized requests.
--
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]