Class WeakCounterConfigurationBuilder
java.lang.Object
org.infinispan.counter.configuration.WeakCounterConfigurationBuilder
- All Implemented Interfaces:
Builder<WeakCounterConfiguration>,Self<WeakCounterConfigurationBuilder>,CounterConfigurationBuilder<WeakCounterConfiguration,WeakCounterConfigurationBuilder>
WeakCounter configuration builder.- Since:
- 9.0
- Author:
- Pedro Ruivo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconcurrencyLevel(int level) Sets the counter's concurrency level.create()Create the configuration beaninitialValue(long initialValue) Sets the counter's initial value.name()Sets the counter's name.Builder<?>read(WeakCounterConfiguration template, Combine combine) Reads the configuration from an already created configuration bean into this builder.self()Sets the counter's storage mode.voidvalidate()Validate the data in this builder before building the configuration bean
-
Constructor Details
-
WeakCounterConfigurationBuilder
-
-
Method Details
-
attributes
-
create
Description copied from interface:BuilderCreate the configuration bean- 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- 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.
-
self
-
concurrencyLevel
Sets the counter's concurrency level.It sets the number of concurrent updates in the counter. A higher value will support a higher number of updates but it increases the read of the counter's value.
Default value is 16.
- Parameters:
level- the new concurrency level.
-
name
Description copied from interface:CounterConfigurationBuilderSets the counter's name.This attribute is required.
- Specified by:
namein interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T, S>> - Parameters:
name- the counter's name.
-
initialValue
Description copied from interface:CounterConfigurationBuilderSets the counter's initial value.Default value is zero.
- Specified by:
initialValuein interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T, S>> - Parameters:
initialValue- the counter's initial value.
-
storage
Description copied from interface:CounterConfigurationBuilderSets the counter's storage mode.Default value is
Storage.VOLATILE.- Specified by:
storagein interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T, S>> - Parameters:
mode- the counter's storage mode.- See Also:
-
validate
public void validate()Description copied from interface:BuilderValidate the data in this builder before building the configuration bean- Specified by:
validatein interfaceBuilder<T extends AbstractCounterConfiguration>
-
name
- Specified by:
namein interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T, S>>
-
addStrongCounter
- Specified by:
addStrongCounterin interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T, S>> - Returns:
- a new builder to configure a strong counter.
-
addWeakCounter
- Specified by:
addWeakCounterin interfaceCounterConfigurationBuilder<T extends AbstractCounterConfiguration,S extends org.infinispan.counter.configuration.AbstractCounterConfigurationBuilder<T, S>> - Returns:
- a new builder to configure a weak counter.
-