Class AppendEntryLimiter
java.lang.Object
com.netflix.concurrency.limits.limiter.AbstractLimiter<Long>
io.camunda.zeebe.logstreams.impl.backpressure.AppendEntryLimiter
- All Implemented Interfaces:
com.netflix.concurrency.limits.Limiter<Long>,AppendLimiter
public final class AppendEntryLimiter
extends com.netflix.concurrency.limits.limiter.AbstractLimiter<Long>
implements AppendLimiter
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.netflix.concurrency.limits.limiter.AbstractLimiter
com.netflix.concurrency.limits.limiter.AbstractLimiter.Builder<BuilderT extends com.netflix.concurrency.limits.limiter.AbstractLimiter.Builder<BuilderT>>Nested classes/interfaces inherited from interface com.netflix.concurrency.limits.Limiter
com.netflix.concurrency.limits.Limiter.Listener -
Field Summary
Fields inherited from class com.netflix.concurrency.limits.limiter.AbstractLimiter
ID_TAG, STATUS_TAG -
Method Summary
Modifier and TypeMethodDescriptionOptional<com.netflix.concurrency.limits.Limiter.Listener>builder()voidonCommit(long position) Notify when then entry with the given position have been committed.protected voidonNewLimit(int newLimit) booleantryAcquire(Long position) Try to add to the in flight appends.Methods inherited from class com.netflix.concurrency.limits.limiter.AbstractLimiter
createListener, createRejectedListener, getInflight, getLimitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.zeebe.logstreams.impl.backpressure.AppendLimiter
getInflight, getLimit
-
Method Details
-
acquire
- Specified by:
acquirein interfacecom.netflix.concurrency.limits.Limiter<Long>
-
tryAcquire
Description copied from interface:AppendLimiterTry to add to the in flight appends. If success,AppendLimiter.onCommit(long)()} must be called when the appending was successful- Specified by:
tryAcquirein interfaceAppendLimiter- Parameters:
position- the corresponding position- Returns:
- true if request is added to the in flight requests, false otherwise
-
onCommit
public void onCommit(long position) Description copied from interface:AppendLimiterNotify when then entry with the given position have been committed. This will release the acquired position and decrement the in flight count.- Specified by:
onCommitin interfaceAppendLimiter- Parameters:
position- the committed position
-
onNewLimit
protected void onNewLimit(int newLimit) - Overrides:
onNewLimitin classcom.netflix.concurrency.limits.limiter.AbstractLimiter<Long>
-
builder
-