Class HashConfigurationBuilder
- java.lang.Object
-
- org.infinispan.configuration.cache.HashConfigurationBuilder
-
- All Implemented Interfaces:
BaseConfigurationInfo,Builder<HashConfiguration>,ConfigurationBuilderInfo,ClusteringConfigurationChildBuilder,ConfigurationChildBuilder
public class HashConfigurationBuilder extends Object implements Builder<HashConfiguration>, ConfigurationBuilderInfo
Allows fine-tuning of rehashing characteristics. Must only used with 'distributed' cache mode.- Author:
- pmuir
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationBuilderbuilder
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.infinispan.commons.configuration.attributes.AttributeSetattributes()Configurationbuild()HashConfigurationBuildercapacityFactor(float capacityFactor)Controls the proportion of entries that will reside on the local node, compared to the other nodes in the cluster.ClusteringConfigurationBuilderclustering()HashConfigurationBuilderconsistentHashFactory(ConsistentHashFactory<? extends ConsistentHash> consistentHashFactory)The consistent hash factory in use.HashConfigurationcreate()Create the configuration beanCustomInterceptorsConfigurationBuildercustomInterceptors()Deprecated.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptorsEncodingConfigurationBuilderencoding()ExpirationConfigurationBuilderexpiration()protected ConfigurationBuildergetBuilder()Collection<ConfigurationBuilderInfo>getChildrenInfo()protected ClusteringConfigurationBuildergetClusteringBuilder()org.infinispan.commons.configuration.elements.ElementDefinitiongetElementDefinition()GroupsConfigurationBuildergroups()HashConfigurationBuilderhash()Allows fine-tuning of rehashing characteristics.IndexingConfigurationBuilderindexing()InvocationBatchingConfigurationBuilderinvocationBatching()HashConfigurationBuilderkeyPartitioner(KeyPartitioner keyPartitioner)Key partitioner, controlling the mapping of keys to hash segments.L1ConfigurationBuilderl1()Configures the L1 cache behavior in 'distributed' caches instances.LockingConfigurationBuilderlocking()MemoryConfigurationBuildermemory()HashConfigurationBuildernumOwners(int numOwners)Number of cluster-wide replicas for each cache entry.HashConfigurationBuildernumSegments(int numSegments)Controls the total number of hash space segments (per cluster).PartitionHandlingConfigurationBuilderpartitionHandling()Configures how the cache will react to cluster partitions.PersistenceConfigurationBuilderpersistence()HashConfigurationBuilderread(HashConfiguration template)Reads the configuration from an already created configuration bean into this builder.SecurityConfigurationBuildersecurity()booleansimpleCache()ConfigurationChildBuildersimpleCache(boolean simpleCache)SitesConfigurationBuildersites()StateTransferConfigurationBuilderstateTransfer()Configures how state is transferred when a new cache joins the cluster.StatisticsConfigurationBuilderstatistics()ConfigurationChildBuildertemplate(boolean template)StringtoString()TransactionConfigurationBuildertransaction()UnsafeConfigurationBuilderunsafe()voidvalidate()Validate the data in this builder before building the configuration beanvoidvalidate(GlobalConfiguration globalConfig)-
Methods inherited from interface org.infinispan.commons.configuration.ConfigurationBuilderInfo
getBuilderInfo, getNewBuilderInfo
-
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
-
getElementDefinition
public org.infinispan.commons.configuration.elements.ElementDefinition getElementDefinition()
- Specified by:
getElementDefinitionin interfaceBaseConfigurationInfo- Returns:
- the
ElementDefinitionof the configuration.
-
consistentHashFactory
public HashConfigurationBuilder consistentHashFactory(ConsistentHashFactory<? extends ConsistentHash> consistentHashFactory)
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, larger
numSegmentsvalues will mean a more even distribution of keys between nodes.On the other hand, the memory/bandwidth usage of the new consistent hash grows linearly with
numSegments. So we recommend keepingnumSegments <= 10 * clusterSize.- 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 of2will 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:BuilderValidate the data in this builder before building the configuration bean- Specified by:
validatein interfaceBuilder<HashConfiguration>
-
validate
public void validate(GlobalConfiguration globalConfig)
- Specified by:
validatein interfaceConfigurationChildBuilder
-
create
public HashConfiguration create()
Description copied from interface:BuilderCreate the configuration bean- Specified by:
createin interfaceBuilder<HashConfiguration>- Returns:
-
read
public HashConfigurationBuilder read(HashConfiguration template)
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<HashConfiguration>- Parameters:
template- the configuration from which to "clone" this config if needed.
-
toString
public String toString()
-
attributes
public org.infinispan.commons.configuration.attributes.AttributeSet attributes()
- Specified by:
attributesin interfaceBaseConfigurationInfo- Returns:
- the
AttributeSetdeclared by the configuration.
-
getChildrenInfo
public Collection<ConfigurationBuilderInfo> getChildrenInfo()
- Specified by:
getChildrenInfoin interfaceConfigurationBuilderInfo- Returns:
- a collection of
ConfigurationBuilderInfofor the sub-elements of the builder.
-
hash
public HashConfigurationBuilder hash()
Description copied from interface:ClusteringConfigurationChildBuilderAllows fine-tuning of rehashing characteristics. Must only used with 'distributed' cache mode.- Specified by:
hashin interfaceClusteringConfigurationChildBuilder
-
l1
public L1ConfigurationBuilder l1()
Description copied from interface:ClusteringConfigurationChildBuilderConfigures the L1 cache behavior in 'distributed' caches instances. In any other cache modes, this element is ignored.- Specified by:
l1in interfaceClusteringConfigurationChildBuilder
-
stateTransfer
public StateTransferConfigurationBuilder stateTransfer()
Description copied from interface:ClusteringConfigurationChildBuilderConfigures how state is transferred when a new cache joins the cluster. Used with distribution and replication clustered modes.- Specified by:
stateTransferin interfaceClusteringConfigurationChildBuilder
-
partitionHandling
public PartitionHandlingConfigurationBuilder partitionHandling()
Description copied from interface:ClusteringConfigurationChildBuilderConfigures how the cache will react to cluster partitions.- Specified by:
partitionHandlingin interfaceClusteringConfigurationChildBuilder
-
getClusteringBuilder
protected ClusteringConfigurationBuilder getClusteringBuilder()
-
template
public ConfigurationChildBuilder template(boolean template)
- Specified by:
templatein interfaceConfigurationChildBuilder
-
simpleCache
public ConfigurationChildBuilder simpleCache(boolean simpleCache)
- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()
- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
clustering
public ClusteringConfigurationBuilder clustering()
- Specified by:
clusteringin 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:
customInterceptorsin interfaceConfigurationChildBuilder
-
encoding
public EncodingConfigurationBuilder encoding()
- Specified by:
encodingin interfaceConfigurationChildBuilder
-
expiration
public ExpirationConfigurationBuilder expiration()
- Specified by:
expirationin interfaceConfigurationChildBuilder
-
indexing
public IndexingConfigurationBuilder indexing()
- Specified by:
indexingin interfaceConfigurationChildBuilder
-
invocationBatching
public InvocationBatchingConfigurationBuilder invocationBatching()
- Specified by:
invocationBatchingin interfaceConfigurationChildBuilder
-
statistics
public StatisticsConfigurationBuilder statistics()
- Specified by:
statisticsin interfaceConfigurationChildBuilder
-
persistence
public PersistenceConfigurationBuilder persistence()
- Specified by:
persistencein interfaceConfigurationChildBuilder
-
locking
public LockingConfigurationBuilder locking()
- Specified by:
lockingin interfaceConfigurationChildBuilder
-
security
public SecurityConfigurationBuilder security()
- Specified by:
securityin interfaceConfigurationChildBuilder
-
transaction
public TransactionConfigurationBuilder transaction()
- Specified by:
transactionin interfaceConfigurationChildBuilder
-
unsafe
public UnsafeConfigurationBuilder unsafe()
- Specified by:
unsafein interfaceConfigurationChildBuilder
-
sites
public SitesConfigurationBuilder sites()
- Specified by:
sitesin interfaceConfigurationChildBuilder
-
memory
public MemoryConfigurationBuilder memory()
- Specified by:
memoryin interfaceConfigurationChildBuilder
-
getBuilder
protected ConfigurationBuilder getBuilder()
-
build
public Configuration build()
- Specified by:
buildin interfaceConfigurationChildBuilder
-
-