@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).
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CongestionControlRateLimitingStrategy.CongestionControlRateLimitingStrategyBuilder
Builder for
CongestionControlRateLimitingStrategy. |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 RateLimitingStrategyrequestInfo - Data class containing information on request being sentpublic void registerCompletedRequest(ResultInfo resultInfo)
RateLimitingStrategyregisterCompletedRequest 在接口中 RateLimitingStrategyresultInfo - Data class containing information on request completedpublic boolean shouldBlock(RequestInfo requestInfo)
RateLimitingStrategyshouldBlock 在接口中 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 在接口中 RateLimitingStrategy@PublicEvolving public static CongestionControlRateLimitingStrategy.CongestionControlRateLimitingStrategyBuilder builder()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.