public static class CounterConfiguration.Builder extends Object
CounterConfiguration
.Modifier and Type | Method and Description |
---|---|
CounterConfiguration |
build() |
CounterConfiguration.Builder |
concurrencyLevel(int concurrencyLevel)
Sets the concurrency level of the counter.
|
CounterConfiguration.Builder |
initialValue(long initialValue)
Sets the initial value.
|
CounterConfiguration.Builder |
lowerBound(long lowerBound)
Sets the lower bound (inclusive) of the counter.
|
CounterConfiguration.Builder |
storage(Storage storage)
Sets the storage mode of the counter.
|
CounterConfiguration.Builder |
upperBound(long upperBound)
Sets the upper bound (inclusive) of the counter.
|
public CounterConfiguration.Builder initialValue(long initialValue)
The default value is zero.
initialValue
- the new initial value.public CounterConfiguration.Builder lowerBound(long lowerBound)
Only for CounterType.BOUNDED_STRONG
counters.
The default value is Long.MIN_VALUE
.
lowerBound
- the new lower bound.public CounterConfiguration.Builder upperBound(long upperBound)
Only for CounterType.BOUNDED_STRONG
counters.
The default value is Long.MAX_VALUE
.
upperBound
- the new upper bound.public CounterConfiguration.Builder storage(Storage storage)
The default value is Storage.VOLATILE
.
storage
- the new storage mode.Storage
public CounterConfiguration.Builder concurrencyLevel(int concurrencyLevel)
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.
concurrencyLevel
- the new concurrency level.public CounterConfiguration build()
CounterConfiguration
with this configuration.Copyright © 2021 JBoss by Red Hat. All rights reserved.