Class CounterManagerConfigurationBuilder
java.lang.Object
org.infinispan.counter.configuration.CounterManagerConfigurationBuilder
- All Implemented Interfaces:
Builder<CounterManagerConfiguration>
public class CounterManagerConfigurationBuilder
extends Object
implements Builder<CounterManagerConfiguration>
The
CounterManager
configuration builder.
It configures the number of owner and the Reliability
mode. It allow to configure the default counter
available on startup.
- Since:
- 9.0
- Author:
- Pedro Ruivo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all the configured counters.counters()
create()
Create the configuration beanstatic CounterManagerConfiguration
numOwner
(int numOwners) Sets the number of copies of the counter's value available in the cluster.Builder<?>
read
(CounterManagerConfiguration template, Combine combine) Reads the configuration from an already created configuration bean into this builder.reliability
(Reliability reliability) Sets theReliability
mode.void
validate()
Validate the data in this builder before building the configuration bean
-
Constructor Details
-
CounterManagerConfigurationBuilder
-
-
Method Details
-
attributes
- Specified by:
attributes
in interfaceBuilder<CounterManagerConfiguration>
-
defaultConfiguration
- Returns:
- the default
CounterManagerConfiguration
.
-
numOwner
Sets the number of copies of the counter's value available in the cluster.A higher value will provide better availability at the cost of more expensive updates.
Default value is 2.
- Parameters:
numOwners
- the number of copies.
-
reliability
Sets theReliability
mode.Default value is
Reliability.AVAILABLE
.- Parameters:
reliability
- theReliability
mode.- See Also:
-
addStrongCounter
- Returns:
- a new
StrongCounterConfigurationBuilder
to configure a strong consistent counters.
-
addWeakCounter
- Returns:
- a new
WeakCounterConfigurationBuilder
to configure weak consistent counters.
-
validate
public void validate()Description copied from interface:Builder
Validate the data in this builder before building the configuration bean- Specified by:
validate
in interfaceBuilder<CounterManagerConfiguration>
-
create
Description copied from interface:Builder
Create the configuration bean- Specified by:
create
in interfaceBuilder<CounterManagerConfiguration>
- Returns:
-
read
Description copied from interface:Builder
Reads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
read
in interfaceBuilder<CounterManagerConfiguration>
- Parameters:
template
- the configuration from which to "clone" this config if needed.combine
- the way attributes and children of this instance and the template should be combined.
-
clearCounters
public void clearCounters()Clears all the configured counters. -
counters
-