Interface RateLimiterStrategy

  • All Superinterfaces:
    Serializable

    @Experimental
    public interface RateLimiterStrategy
    extends Serializable
    A factory for RateLimiters which apply rate-limiting to a source sub-task.
    • Method Detail

      • createRateLimiter

        RateLimiter createRateLimiter​(int parallelism)
        Creates a RateLimiter that lets records through with rate proportional to the parallelism. This method will be called once per source subtask. The cumulative rate over all rate limiters for a source must not exceed the rate limit configured for the strategy.
      • perSecond

        static RateLimiterStrategy perSecond​(double recordsPerSecond)
        Creates a RateLimiterStrategy that is limiting the number of records per second.
        Parameters:
        recordsPerSecond - The number of records produced per second. The actual number of produced records is subject to rounding due to dividing the number of produced records among the parallel instances.
      • perCheckpoint

        static RateLimiterStrategy perCheckpoint​(int recordsPerCheckpoint)
        Creates a RateLimiterStrategy that is limiting the number of records per checkpoint.
        Parameters:
        recordsPerCheckpoint - The number of records produced per checkpoint. This value has to be greater or equal to parallelism. The actual number of produced records is subject to rounding due to dividing the number of produced records among the parallel instances.
      • noOp

        static RateLimiterStrategy noOp()
        Creates a convenience RateLimiterStrategy that is not limiting the records rate.