Modifier and Type | Class and Description |
---|---|
static class |
LookupPartitionStrategy.Builder<T> |
Strategy.Token
Modifier and Type | Method and Description |
---|---|
int |
getLimit() |
static <T> LookupPartitionStrategy.Builder<T> |
newBuilder(java.util.function.Function<T,java.lang.String> lookup) |
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> LookupPartitionStrategy.Builder<T> newBuilder(java.util.function.Function<T,java.lang.String> lookup)
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 java.lang.String toString()
toString
in class java.lang.Object