Class NoopRequestLimiter<ContextT>
- java.lang.Object
-
- io.camunda.zeebe.broker.transport.backpressure.NoopRequestLimiter<ContextT>
-
- All Implemented Interfaces:
RequestLimiter<ContextT>
public final class NoopRequestLimiter<ContextT> extends Object implements RequestLimiter<ContextT>
-
-
Constructor Summary
Constructors Constructor Description NoopRequestLimiter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetInflightCount()intgetLimit()voidonIgnore(int streamId, long requestId)Notify when a request is cancelled afterRequestLimiter.tryAcquire(int, long, Object)was success.voidonResponse(int streamId, long requestId)Notify when a request processing is completed by calling this method.booleantryAcquire(int streamId, long requestId, ContextT context)Try to add to the inflight requests.
-
-
-
Method Detail
-
tryAcquire
public boolean tryAcquire(int streamId, long requestId, ContextT context)Description copied from interface:RequestLimiterTry to add to the inflight requests. If success,RequestLimiter.onResponse(int, long)()} must be called when the request * is processed.- Specified by:
tryAcquirein interfaceRequestLimiter<ContextT>context- some limiters may use additional context to decide if a request should be accepted- Returns:
- true if request is added to the inflight requests, false otherwise
-
onResponse
public void onResponse(int streamId, long requestId)Description copied from interface:RequestLimiterNotify when a request processing is completed by calling this method.- Specified by:
onResponsein interfaceRequestLimiter<ContextT>
-
onIgnore
public void onIgnore(int streamId, long requestId)Description copied from interface:RequestLimiterNotify when a request is cancelled afterRequestLimiter.tryAcquire(int, long, Object)was success.- Specified by:
onIgnorein interfaceRequestLimiter<ContextT>
-
getLimit
public int getLimit()
- Specified by:
getLimitin interfaceRequestLimiter<ContextT>
-
getInflightCount
public int getInflightCount()
- Specified by:
getInflightCountin interfaceRequestLimiter<ContextT>
-
-