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 Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested 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 Type
    Method
    Description
    Optional<com.netflix.concurrency.limits.Limiter.Listener>
    acquire(Long position)
     
     
    void
    onCommit(long position)
    Notify when then entry with the given position have been committed.
    protected void
    onNewLimit(int newLimit)
     
    boolean
    tryAcquire(Long position)
    Try to add to the in flight appends.

    Methods inherited from class com.netflix.concurrency.limits.limiter.AbstractLimiter

    createListener, createRejectedListener, getInflight, getLimit

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.camunda.zeebe.logstreams.impl.backpressure.AppendLimiter

    getInflight, getLimit
  • Method Details

    • acquire

      public Optional<com.netflix.concurrency.limits.Limiter.Listener> acquire(Long position)
      Specified by:
      acquire in interface com.netflix.concurrency.limits.Limiter<Long>
    • tryAcquire

      public boolean tryAcquire(Long position)
      Description copied from interface: AppendLimiter
      Try to add to the in flight appends. If success, AppendLimiter.onCommit(long) ()} must be called when the appending was successful
      Specified by:
      tryAcquire in interface AppendLimiter
      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: AppendLimiter
      Notify when then entry with the given position have been committed. This will release the acquired position and decrement the in flight count.
      Specified by:
      onCommit in interface AppendLimiter
      Parameters:
      position - the committed position
    • onNewLimit

      protected void onNewLimit(int newLimit)
      Overrides:
      onNewLimit in class com.netflix.concurrency.limits.limiter.AbstractLimiter<Long>
    • builder