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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears all the configured counters.counters()create()Create the configuration beanstatic CounterManagerConfigurationnumOwner(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 theReliabilitymode.voidvalidate()Validate the data in this builder before building the configuration bean
-
Constructor Details
-
CounterManagerConfigurationBuilder
-
-
Method Details
-
attributes
- Specified by:
attributesin 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 theReliabilitymode.Default value is
Reliability.AVAILABLE.- Parameters:
reliability- theReliabilitymode.- See Also:
-
addStrongCounter
- Returns:
- a new
StrongCounterConfigurationBuilderto configure a strong consistent counters.
-
addWeakCounter
- Returns:
- a new
WeakCounterConfigurationBuilderto configure weak consistent counters.
-
validate
public void validate()Description copied from interface:BuilderValidate the data in this builder before building the configuration bean- Specified by:
validatein interfaceBuilder<CounterManagerConfiguration>
-
create
Description copied from interface:BuilderCreate the configuration bean- Specified by:
createin interfaceBuilder<CounterManagerConfiguration>- Returns:
-
read
Description copied from interface:BuilderReads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
readin 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
-