Class GuavaRateLimiter<Split extends SourceSplit>

  • All Implemented Interfaces:
    RateLimiter<Split>

    @Internal
    public class GuavaRateLimiter<Split extends SourceSplit>
    extends Object
    implements RateLimiter<Split>
    An implementation of RateLimiter based on Guava's RateLimiter.
    • Constructor Detail

      • GuavaRateLimiter

        public GuavaRateLimiter​(double maxPerSecond)
    • Method Detail

      • acquire

        public CompletionStage<Void> acquire​(int numberOfEvents)
        Description copied from interface: RateLimiter
        Returns 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:
        acquire in interface RateLimiter<Split extends SourceSplit>
        Parameters:
        numberOfEvents - The number of events.