Class HashConfigurationBuilder
- java.lang.Object
-
- org.infinispan.configuration.cache.HashConfigurationBuilder
-
- All Implemented Interfaces:
Builder<HashConfiguration>
,ClusteringConfigurationChildBuilder
,ConfigurationChildBuilder
public class HashConfigurationBuilder extends Object implements Builder<HashConfiguration>
Allows fine-tuning of rehashing characteristics. Must only used with 'distributed' cache mode.- Author:
- pmuir
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationBuilder
builder
-
Method Summary
-
Methods inherited from interface org.infinispan.configuration.cache.ConfigurationChildBuilder
build, clustering, customInterceptors, encoding, expiration, indexing, invocationBatching, jmxStatistics, locking, memory, persistence, security, simpleCache, simpleCache, sites, statistics, template, transaction, unsafe
-
-
-
-
Field Detail
-
builder
protected final ConfigurationBuilder builder
-
-
Method Detail
-
consistentHashFactory
@Deprecated public HashConfigurationBuilder consistentHashFactory(ConsistentHashFactory<? extends ConsistentHash> consistentHashFactory)
Deprecated.Since 11.0. Will be removed in 14.0, the segment allocation will no longer be customizable.The consistent hash factory in use.
-
numOwners
public HashConfigurationBuilder numOwners(int numOwners)
Number of cluster-wide replicas for each cache entry.
-
numSegments
public HashConfigurationBuilder numSegments(int numSegments)
Controls the total number of hash space segments (per cluster).A hash space segment is the granularity for key distribution in the cluster: a node can own (or primary-own) one or more full segments, but not a fraction of a segment. As such, very small
numSegments
values (< 10 segments per node) will make the distribution of keys between nodes more uneven.The recommended value is 20 * the expected cluster size.
Note: The value returned by
ConsistentHash.getNumSegments()
may be different, e.g. rounded up to a power of 2.- Parameters:
numSegments
- the number of hash space segments. Must be strictly positive.
-
capacityFactor
public HashConfigurationBuilder capacityFactor(float capacityFactor)
Controls the proportion of entries that will reside on the local node, compared to the other nodes in the cluster. This is just a suggestion, there is no guarantee that a node with a capacity factor of2
will have twice as many entries as a node with a capacity factor of1
.- Parameters:
capacityFactor
- the capacity factor for the local node. Must be positive.
-
keyPartitioner
public HashConfigurationBuilder keyPartitioner(KeyPartitioner keyPartitioner)
Key partitioner, controlling the mapping of keys to hash segments.The default implementation is
org.infinispan.distribution.ch.impl.HashFunctionPartitioner
, usesMurmurHash3
.- Since:
- 8.2
-
groups
public GroupsConfigurationBuilder groups()
-
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<HashConfiguration>
-
validate
public void validate(GlobalConfiguration globalConfig)
- Specified by:
validate
in interfaceConfigurationChildBuilder
-
create
public HashConfiguration create()
Description copied from interface:Builder
Create the configuration bean- Specified by:
create
in interfaceBuilder<HashConfiguration>
- Returns:
-
read
public HashConfigurationBuilder read(HashConfiguration template)
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<HashConfiguration>
- Parameters:
template
- the configuration from which to "clone" this config if needed.
-
toString
public String toString()
-
hash
public HashConfigurationBuilder hash()
Description copied from interface:ClusteringConfigurationChildBuilder
Allows fine-tuning of rehashing characteristics. Must only used with 'distributed' cache mode.- Specified by:
hash
in interfaceClusteringConfigurationChildBuilder
-
l1
public L1ConfigurationBuilder l1()
Description copied from interface:ClusteringConfigurationChildBuilder
Configures the L1 cache behavior in 'distributed' caches instances. In any other cache modes, this element is ignored.- Specified by:
l1
in interfaceClusteringConfigurationChildBuilder
-
stateTransfer
public StateTransferConfigurationBuilder stateTransfer()
Description copied from interface:ClusteringConfigurationChildBuilder
Configures how state is transferred when a new cache joins the cluster. Used with distribution and replication clustered modes.- Specified by:
stateTransfer
in interfaceClusteringConfigurationChildBuilder
-
partitionHandling
public PartitionHandlingConfigurationBuilder partitionHandling()
Description copied from interface:ClusteringConfigurationChildBuilder
Configures how the cache will react to cluster partitions.- Specified by:
partitionHandling
in interfaceClusteringConfigurationChildBuilder
-
getClusteringBuilder
protected ClusteringConfigurationBuilder getClusteringBuilder()
-
template
public ConfigurationChildBuilder template(boolean template)
- Specified by:
template
in interfaceConfigurationChildBuilder
-
simpleCache
public ConfigurationChildBuilder simpleCache(boolean simpleCache)
- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()
- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
clustering
public ClusteringConfigurationBuilder clustering()
- Specified by:
clustering
in interfaceConfigurationChildBuilder
-
customInterceptors
@Deprecated public CustomInterceptorsConfigurationBuilder customInterceptors()
Deprecated.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptors- Specified by:
customInterceptors
in interfaceConfigurationChildBuilder
-
encoding
public EncodingConfigurationBuilder encoding()
- Specified by:
encoding
in interfaceConfigurationChildBuilder
-
expiration
public ExpirationConfigurationBuilder expiration()
- Specified by:
expiration
in interfaceConfigurationChildBuilder
-
indexing
public IndexingConfigurationBuilder indexing()
- Specified by:
indexing
in interfaceConfigurationChildBuilder
-
invocationBatching
public InvocationBatchingConfigurationBuilder invocationBatching()
- Specified by:
invocationBatching
in interfaceConfigurationChildBuilder
-
statistics
public StatisticsConfigurationBuilder statistics()
- Specified by:
statistics
in interfaceConfigurationChildBuilder
-
persistence
public PersistenceConfigurationBuilder persistence()
- Specified by:
persistence
in interfaceConfigurationChildBuilder
-
locking
public LockingConfigurationBuilder locking()
- Specified by:
locking
in interfaceConfigurationChildBuilder
-
security
public SecurityConfigurationBuilder security()
- Specified by:
security
in interfaceConfigurationChildBuilder
-
transaction
public TransactionConfigurationBuilder transaction()
- Specified by:
transaction
in interfaceConfigurationChildBuilder
-
unsafe
public UnsafeConfigurationBuilder unsafe()
- Specified by:
unsafe
in interfaceConfigurationChildBuilder
-
sites
public SitesConfigurationBuilder sites()
- Specified by:
sites
in interfaceConfigurationChildBuilder
-
memory
public MemoryConfigurationBuilder memory()
- Specified by:
memory
in interfaceConfigurationChildBuilder
-
getBuilder
protected ConfigurationBuilder getBuilder()
-
build
public Configuration build()
- Specified by:
build
in interfaceConfigurationChildBuilder
-
-