@PublicEvolving
public interface RateLimitingStrategy
registerInFlightRequest(RequestInfo) and registerCompletedRequest(ResultInfo). It will then use that information to make a decision to
whether a given request should be blocked or allowed through.| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
void registerInFlightRequest(RequestInfo requestInfo)
requestInfo - Data class containing information on request being sentvoid registerCompletedRequest(ResultInfo resultInfo)
resultInfo - Data class containing information on request completedboolean shouldBlock(RequestInfo requestInfo)
requestInfo - Data class containing information on request being sentint getMaxBatchSize()
ResultInfo that is passed into
shouldBlock(RequestInfo) can construct a passable ResultInfo.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.