public final class PredicatePartitionStrategy<T> extends java.lang.Object implements Strategy<T>
Modifier and Type | Class and Description |
---|---|
static class |
PredicatePartitionStrategy.Builder<T> |
Strategy.Token
Modifier and Type | Method and Description |
---|---|
int |
getBusyCount() |
int |
getLimit() |
static <T> PredicatePartitionStrategy.Builder<T> |
newBuilder() |
void |
setLimit(int newLimit)
Update the strategy with a new limit
|
java.lang.String |
toString() |
java.util.Optional<Strategy.Token> |
tryAcquire(T type)
Try to acquire a token from the limiter.
|
public static <T> PredicatePartitionStrategy.Builder<T> newBuilder()
public java.util.Optional<Strategy.Token> tryAcquire(T type)
Strategy
tryAcquire
in interface Strategy<T>
type
- Context of the request for partitioned limitsStrategy.Token
that must be released when
the operation completes.public void setLimit(int newLimit)
Strategy
public int getLimit()
public int getBusyCount()
public java.lang.String toString()
toString
in class java.lang.Object