BuilderT
- Concrete builder type specific to an RPC mechanismContextT
- Type capturing the context of a request for the concrete RPC mechanismpublic abstract class AbstractLimiterBuilder<BuilderT extends AbstractLimiterBuilder<BuilderT,ContextT>,ContextT>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected LookupPartitionStrategy.Builder<ContextT> |
builder |
protected Strategy<ContextT> |
strategy |
Constructor and Description |
---|
AbstractLimiterBuilder() |
Modifier and Type | Method and Description |
---|---|
protected Limiter<ContextT> |
buildLimiter() |
BuilderT |
limit(Limit limit)
Deprecated.
|
BuilderT |
limiter(java.util.function.Consumer<DefaultLimiter.Builder> consumer) |
BuilderT |
partitionByLookup(java.util.function.Function<ContextT,java.lang.String> contextToGroup,
java.util.function.Consumer<LookupPartitionStrategy.Builder<ContextT>> configurer)
Configure the strategy for partitioning the limit.
|
protected abstract BuilderT |
self() |
BuilderT |
strategy(Strategy<ContextT> strategy)
Strategy for acquiring a token from the limiter based on the context.
|
protected LookupPartitionStrategy.Builder<ContextT> builder
public BuilderT partitionByLookup(java.util.function.Function<ContextT,java.lang.String> contextToGroup, java.util.function.Consumer<LookupPartitionStrategy.Builder<ContextT>> configurer)
contextToGroup
- Mapper from the context to a name group associated with a percentage of the limitconfigurer
- Function through which the value set support by the func may be assigned
a percentage of the limitpublic BuilderT strategy(Strategy<ContextT> strategy)
strategy
- @Deprecated public BuilderT limit(Limit limit)
limiter(Consumer)
VegasLimit
limit
- Limit algorithm to usepublic BuilderT limiter(java.util.function.Consumer<DefaultLimiter.Builder> consumer)
protected abstract BuilderT self()