@Experimental public interface RateLimiterStrategy extends Serializable
RateLimiters
which apply rate-limiting to a source sub-task.Modifier and Type | Method and Description |
---|---|
RateLimiter |
createRateLimiter(int parallelism)
Creates a
RateLimiter that lets records through with rate proportional to the
parallelism. |
static RateLimiterStrategy |
noOp()
Creates a convenience
RateLimiterStrategy that is not limiting the records rate. |
static RateLimiterStrategy |
perCheckpoint(int recordsPerCheckpoint)
Creates a
RateLimiterStrategy that is limiting the number of records per checkpoint. |
static RateLimiterStrategy |
perSecond(double recordsPerSecond)
Creates a
RateLimiterStrategy that is limiting the number of records per second. |
RateLimiter createRateLimiter(int parallelism)
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.static RateLimiterStrategy perSecond(double recordsPerSecond)
RateLimiterStrategy
that is limiting the number of records per second.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.static RateLimiterStrategy perCheckpoint(int recordsPerCheckpoint)
RateLimiterStrategy
that is limiting the number of records per checkpoint.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.static RateLimiterStrategy noOp()
RateLimiterStrategy
that is not limiting the records rate.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.