Class RateLimitPolicyFactory.DefaultRateLimiter
java.lang.Object
org.apache.beam.sdk.io.aws2.kinesis.RateLimitPolicyFactory.DefaultRateLimiter
- All Implemented Interfaces:
RateLimitPolicy
- Enclosing interface:
RateLimitPolicyFactory
public static class RateLimitPolicyFactory.DefaultRateLimiter
extends Object
implements RateLimitPolicy
Default rate limiter that throttles reading from a shard using an exponential backoff if the
response is empty or if the consumer is throttled by AWS.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultRateLimiter
(org.apache.beam.sdk.util.BackOff emptySuccess, org.apache.beam.sdk.util.BackOff throttled) DefaultRateLimiter
(Duration emptySuccessBaseDelay, Duration throttledBaseDelay, Duration maxDelay) -
Method Summary
Modifier and TypeMethodDescriptionvoid
onSuccess
(List<KinesisRecord> records) Called after Kinesis records are successfully retrieved.void
Called after the Kinesis client is throttled.
-
Constructor Details
-
DefaultRateLimiter
public DefaultRateLimiter(org.apache.beam.sdk.util.BackOff emptySuccess, org.apache.beam.sdk.util.BackOff throttled) -
DefaultRateLimiter
-
-
Method Details
-
onSuccess
Description copied from interface:RateLimitPolicy
Called after Kinesis records are successfully retrieved.- Specified by:
onSuccess
in interfaceRateLimitPolicy
- Parameters:
records
- The list of retrieved records.- Throws:
InterruptedException
-
onThrottle
Description copied from interface:RateLimitPolicy
Called after the Kinesis client is throttled.- Specified by:
onThrottle
in interfaceRateLimitPolicy
- Parameters:
e
- TheKinesisClientThrottledException
thrown by the client.- Throws:
InterruptedException
-