Class HashConfiguration
- java.lang.Object
-
- org.infinispan.configuration.cache.HashConfiguration
-
- All Implemented Interfaces:
Matchable<HashConfiguration>
public class HashConfiguration extends Object implements Matchable<HashConfiguration>
Allows fine-tuning of rehashing characteristics. Must only used with 'distributed' cache mode.- Author:
- pmuir
-
-
Field Summary
Fields Modifier and Type Field Description static AttributeDefinition<Float>CAPACITY_FACTORstatic AttributeDefinition<ConsistentHashFactory>CONSISTENT_HASH_FACTORYstatic AttributeDefinition<Hash>HASHstatic AttributeDefinition<KeyPartitioner>KEY_PARTITIONERstatic AttributeDefinition<Integer>NUM_OWNERSstatic AttributeDefinition<Integer>NUM_SEGMENTS
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AttributeSetattributes()floatcapacityFactor()Controls the proportion of entries that will reside on the local node, compared to the other nodes in the cluster.ConsistentHashconsistentHash()Deprecated.Since 5.2, replaced byconsistentHashFactory().ConsistentHashFactory<?>consistentHashFactory()The consistent hash factory in use.booleanequals(Object obj)GroupsConfigurationgroups()Configuration for various grouper definitions.Hashhash()Deprecated.Since 8.2, usekeyPartitioner()instead.inthashCode()KeyPartitionerkeyPartitioner()booleanmatches(HashConfiguration other)intnumOwners()Number of cluster-wide replicas for each cache entry.intnumSegments()Controls the total number of hash space segments (per cluster).booleanrehashEnabled()Deprecated.UseStateTransferConfiguration.fetchInMemoryState()instead.longrehashRpcTimeout()Deprecated.UseStateTransferConfiguration.timeout()instead.longrehashWait()Deprecated.UseStateTransferConfiguration.timeout()instead.StringtoString()
-
-
-
Field Detail
-
CONSISTENT_HASH_FACTORY
public static final AttributeDefinition<ConsistentHashFactory> CONSISTENT_HASH_FACTORY
-
HASH
public static final AttributeDefinition<Hash> HASH
-
NUM_OWNERS
public static final AttributeDefinition<Integer> NUM_OWNERS
-
NUM_SEGMENTS
public static final AttributeDefinition<Integer> NUM_SEGMENTS
-
CAPACITY_FACTOR
public static final AttributeDefinition<Float> CAPACITY_FACTOR
-
KEY_PARTITIONER
public static final AttributeDefinition<KeyPartitioner> KEY_PARTITIONER
-
-
Method Detail
-
consistentHash
@Deprecated public ConsistentHash consistentHash()
Deprecated.Since 5.2, replaced byconsistentHashFactory().
-
consistentHashFactory
public ConsistentHashFactory<?> consistentHashFactory()
The consistent hash factory in use.
-
hash
@Deprecated public Hash hash()
Deprecated.Since 8.2, usekeyPartitioner()instead.The hash function in use. Used as a bit spreader and a general hash code generator. Typically one of the the many defaultConsistentHashimplementations shipped.
-
numOwners
public int numOwners()
Number of cluster-wide replicas for each cache entry.
-
numSegments
public 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.
-
rehashEnabled
@Deprecated public boolean rehashEnabled()
Deprecated.UseStateTransferConfiguration.fetchInMemoryState()instead.If false, no rebalancing or rehashing will take place when a new node joins the cluster or a node leaves
-
rehashRpcTimeout
@Deprecated public long rehashRpcTimeout()
Deprecated.UseStateTransferConfiguration.timeout()instead.Rehashing timeout
-
rehashWait
@Deprecated public long rehashWait()
Deprecated.UseStateTransferConfiguration.timeout()instead.
-
capacityFactor
public 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.
-
keyPartitioner
public KeyPartitioner keyPartitioner()
-
groups
public GroupsConfiguration groups()
Configuration for various grouper definitions. See the user guide for more information.
-
attributes
public AttributeSet attributes()
-
matches
public boolean matches(HashConfiguration other)
- Specified by:
matchesin interfaceMatchable<HashConfiguration>
-
-