Class GuavaRateLimiter<Split extends SourceSplit>
- java.lang.Object
-
- org.apache.flink.api.connector.source.util.ratelimit.GuavaRateLimiter<Split>
-
- All Implemented Interfaces:
RateLimiter<Split>
@Internal public class GuavaRateLimiter<Split extends SourceSplit> extends Object implements RateLimiter<Split>
An implementation ofRateLimiterbased on Guava's RateLimiter.
-
-
Constructor Summary
Constructors Constructor Description GuavaRateLimiter(double maxPerSecond)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<Void>acquire(int numberOfEvents)Returns a future that is completed once other events would not exceed the rate limit.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.api.connector.source.util.ratelimit.RateLimiter
acquire, notifyAddingSplit, notifyCheckpointComplete
-
-
-
-
Method Detail
-
acquire
public CompletionStage<Void> acquire(int numberOfEvents)
Description copied from interface:RateLimiterReturns a future that is completed once other events 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.- Specified by:
acquirein interfaceRateLimiter<Split extends SourceSplit>- Parameters:
numberOfEvents- The number of events.
-
-