@PublicEvolving public class CongestionControlRateLimitingStrategy extends Object implements RateLimitingStrategy
RateLimitingStrategy implementation that does the following:
This strategy works well for throughput-limited record-based sinks (e.g. Kinesis, Kafka).
| Modifier and Type | Class and Description |
|---|---|
static class |
CongestionControlRateLimitingStrategy.CongestionControlRateLimitingStrategyBuilder
Builder for
CongestionControlRateLimitingStrategy. |
| Modifier and Type | Method and Description |
|---|---|
static CongestionControlRateLimitingStrategy.CongestionControlRateLimitingStrategyBuilder |
builder() |
int |
getMaxBatchSize()
Returns the current max batch size that RateLimitingStrategy will allow through.
|
void |
registerCompletedRequest(ResultInfo resultInfo)
Registers the result of completed requests (e.g. to track the current inFlightMessages /
requests).
|
void |
registerInFlightRequest(RequestInfo requestInfo)
Registers the information of requests being sent (e.g. to track the current inFlightMessages
/ requests).
|
boolean |
shouldBlock(RequestInfo requestInfo)
Decides whether the next request should be blocked.
|
public void registerInFlightRequest(RequestInfo requestInfo)
RateLimitingStrategyregisterInFlightRequest in interface RateLimitingStrategyrequestInfo - Data class containing information on request being sentpublic void registerCompletedRequest(ResultInfo resultInfo)
RateLimitingStrategyregisterCompletedRequest in interface RateLimitingStrategyresultInfo - Data class containing information on request completedpublic boolean shouldBlock(RequestInfo requestInfo)
RateLimitingStrategyshouldBlock in interface RateLimitingStrategyrequestInfo - Data class containing information on request being sentpublic int getMaxBatchSize()
RateLimitingStrategyResultInfo that is passed into
RateLimitingStrategy.shouldBlock(RequestInfo) can construct a passable ResultInfo.getMaxBatchSize in interface RateLimitingStrategy@PublicEvolving public static CongestionControlRateLimitingStrategy.CongestionControlRateLimitingStrategyBuilder builder()
Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.