@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)
RateLimitingStrategy
registerInFlightRequest
in interface RateLimitingStrategy
requestInfo
- Data class containing information on request being sentpublic void registerCompletedRequest(ResultInfo resultInfo)
RateLimitingStrategy
registerCompletedRequest
in interface RateLimitingStrategy
resultInfo
- Data class containing information on request completedpublic boolean shouldBlock(RequestInfo requestInfo)
RateLimitingStrategy
shouldBlock
in interface RateLimitingStrategy
requestInfo
- Data class containing information on request being sentpublic int getMaxBatchSize()
RateLimitingStrategy
ResultInfo
that is passed into
RateLimitingStrategy.shouldBlock(RequestInfo)
can construct a passable ResultInfo
.getMaxBatchSize
in interface RateLimitingStrategy
@PublicEvolving public static CongestionControlRateLimitingStrategy.CongestionControlRateLimitingStrategyBuilder builder()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.