Package org.infinispan.counter.api
Class CounterConfiguration.Builder
java.lang.Object
org.infinispan.counter.api.CounterConfiguration.Builder
- Enclosing class:
- CounterConfiguration
The builder of
CounterConfiguration
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
concurrencyLevel
(int concurrencyLevel) Sets the concurrency level of the counter.initialValue
(long initialValue) Sets the initial value.lifespan
(long lifespan) lowerBound
(long lowerBound) Sets the lower bound (inclusive) of the counter.Sets the storage mode of the counter.upperBound
(long upperBound) Sets the upper bound (inclusive) of the counter.
-
Method Details
-
initialValue
Sets the initial value.The default value is zero.
- Parameters:
initialValue
- the new initial value.
-
lowerBound
Sets the lower bound (inclusive) of the counter.Only for
CounterType.BOUNDED_STRONG
counters.The default value is
Long.MIN_VALUE
.- Parameters:
lowerBound
- the new lower bound.
-
upperBound
Sets the upper bound (inclusive) of the counter.Only for
CounterType.BOUNDED_STRONG
counters.The default value is
Long.MAX_VALUE
.- Parameters:
upperBound
- the new upper bound.
-
lifespan
-
storage
Sets the storage mode of the counter.The default value is
Storage.VOLATILE
.- Parameters:
storage
- the new storage mode.- See Also:
-
concurrencyLevel
Sets the concurrency level of the counter.Only for
CounterType.WEAK
.The concurrency level set the amount of concurrent updates that can happen simultaneous. It is trade-off between the write performance and read performance. A higher value will allow more concurrent updates, however it will take more time to compute the counter value.
The default value is 64.
- Parameters:
concurrencyLevel
- the new concurrency level.
-
build
- Returns:
- the
CounterConfiguration
with this configuration.
-