Interface AppendLimiter
- All Known Implementing Classes:
AppendEntryLimiter,NoopAppendLimiter
public interface AppendLimiter
-
Method Summary
Modifier and TypeMethodDescriptionintThe current in flight append request count.intgetLimit()The current limit of concurrent appends.voidonCommit(long position) Notify when then entry with the given position have been committed.booleantryAcquire(Long position) Try to add to the in flight appends.
-
Method Details
-
tryAcquire
Try to add to the in flight appends. If success,onCommit(long)()} must be called when the appending was successful- Parameters:
position- the corresponding position- Returns:
- true if request is added to the in flight requests, false otherwise
-
onCommit
void onCommit(long position) Notify when then entry with the given position have been committed. This will release the acquired position and decrement the in flight count.- Parameters:
position- the committed position
-
getInflight
int getInflight()The current in flight append request count.- Returns:
- the current in flight
-
getLimit
int getLimit()The current limit of concurrent appends.- Returns:
- the limit
-