Class HashConfiguration
java.lang.Object
org.infinispan.commons.configuration.attributes.ConfigurationElement<HashConfiguration>
org.infinispan.configuration.cache.HashConfiguration
- All Implemented Interfaces:
org.infinispan.commons.configuration.attributes.Matchable<HashConfiguration>, org.infinispan.commons.configuration.attributes.Updatable<HashConfiguration>
public class HashConfiguration
extends org.infinispan.commons.configuration.attributes.ConfigurationElement<HashConfiguration>
Allows fine-tuning of rehashing characteristics. Must be used only with 'distributed' cache mode.
- Author:
- pmuir
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.infinispan.commons.configuration.attributes.AttributeDefinition<Float> static final org.infinispan.commons.configuration.attributes.AttributeDefinition<KeyPartitioner> static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Integer> static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Integer> Fields inherited from class org.infinispan.commons.configuration.attributes.ConfigurationElement
attributes, CHILDLESS, children, element, repeated -
Method Summary
Modifier and TypeMethodDescriptionfloatControls the proportion of entries that will reside on the local node, compared to the other nodes in the cluster.groups()Configuration for various grouper definitions.booleanmatches(HashConfiguration other, org.infinispan.commons.configuration.attributes.ConfigurationElement<?> parent) intNumber of cluster-wide replicas for each cache entry.intControls the total number of hash space segments (per cluster).voidupdate(String parentName, HashConfiguration other, org.infinispan.commons.configuration.attributes.ConfigurationElement<?> parent) voidvalidateUpdate(String parentName, HashConfiguration other, org.infinispan.commons.configuration.attributes.ConfigurationElement<?> parent) Methods inherited from class org.infinispan.commons.configuration.attributes.ConfigurationElement
attributes, child, children, children, elementName, equals, extractAttributes, findAttribute, hashCode, isModified, list, matches, matches, toString, update, update, validateUpdate, validateUpdate, write
-
Field Details
-
NUM_OWNERS
public static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Integer> NUM_OWNERS -
NUM_SEGMENTS
public static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Integer> NUM_SEGMENTS -
CAPACITY_FACTOR
public static final org.infinispan.commons.configuration.attributes.AttributeDefinition<Float> CAPACITY_FACTOR -
KEY_PARTITIONER
public static final org.infinispan.commons.configuration.attributes.AttributeDefinition<KeyPartitioner> KEY_PARTITIONER
-
-
Method Details
-
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, very small
numSegmentsvalues (< 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. -
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
-
groups
Configuration for various grouper definitions. See the user guide for more information. -
matches
public boolean matches(HashConfiguration other, org.infinispan.commons.configuration.attributes.ConfigurationElement<?> parent) - Overrides:
matchesin classorg.infinispan.commons.configuration.attributes.ConfigurationElement<HashConfiguration>
-
update
public void update(String parentName, HashConfiguration other, org.infinispan.commons.configuration.attributes.ConfigurationElement<?> parent) - Overrides:
updatein classorg.infinispan.commons.configuration.attributes.ConfigurationElement<HashConfiguration>
-
validateUpdate
public void validateUpdate(String parentName, HashConfiguration other, org.infinispan.commons.configuration.attributes.ConfigurationElement<?> parent) - Overrides:
validateUpdatein classorg.infinispan.commons.configuration.attributes.ConfigurationElement<HashConfiguration>
-