Class HashConfiguration
- java.lang.Object
-
- org.infinispan.configuration.cache.HashConfiguration
-
- All Implemented Interfaces:
org.infinispan.commons.configuration.attributes.Matchable<HashConfiguration>,BaseConfigurationInfo,ConfigurationInfo
public class HashConfiguration extends Object implements org.infinispan.commons.configuration.attributes.Matchable<HashConfiguration>, ConfigurationInfo
Allows fine-tuning of rehashing characteristics. Must only used with 'distributed' cache mode.- Author:
- pmuir
-
-
Field Summary
Fields Modifier and Type Field Description static org.infinispan.commons.configuration.attributes.AttributeDefinition<Float>CAPACITY_FACTORstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<ConsistentHashFactory>CONSISTENT_HASH_FACTORYstatic org.infinispan.commons.configuration.elements.ElementDefinitionELEMENT_DEFINITIONstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<KeyPartitioner>KEY_PARTITIONERstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<Integer>NUM_OWNERSstatic org.infinispan.commons.configuration.attributes.AttributeDefinition<Integer>NUM_SEGMENTS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.infinispan.commons.configuration.attributes.AttributeSetattributes()floatcapacityFactor()Controls the proportion of entries that will reside on the local node, compared to the other nodes in the cluster.ConsistentHashFactory<?>consistentHashFactory()The consistent hash factory in use.booleanequals(Object obj)org.infinispan.commons.configuration.elements.ElementDefinitiongetElementDefinition()GroupsConfigurationgroups()Configuration for various grouper definitions.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).List<ConfigurationInfo>subElements()StringtoString()
-
-
-
Field Detail
-
CONSISTENT_HASH_FACTORY
public static final org.infinispan.commons.configuration.attributes.AttributeDefinition<ConsistentHashFactory> CONSISTENT_HASH_FACTORY
-
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
-
ELEMENT_DEFINITION
public static final org.infinispan.commons.configuration.elements.ElementDefinition ELEMENT_DEFINITION
-
-
Method Detail
-
consistentHashFactory
public ConsistentHashFactory<?> consistentHashFactory()
The consistent hash factory in use.
-
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.
-
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 org.infinispan.commons.configuration.attributes.AttributeSet attributes()
- Specified by:
attributesin interfaceBaseConfigurationInfo- Returns:
- the
AttributeSetdeclared by the configuration.
-
getElementDefinition
public org.infinispan.commons.configuration.elements.ElementDefinition getElementDefinition()
- Specified by:
getElementDefinitionin interfaceBaseConfigurationInfo- Returns:
- the
ElementDefinitionof the configuration.
-
subElements
public List<ConfigurationInfo> subElements()
- Specified by:
subElementsin interfaceConfigurationInfo- Returns:
- the list of sub elements.
-
toString
public String toString()
-
equals
public boolean equals(Object obj)
-
hashCode
public int hashCode()
-
matches
public boolean matches(HashConfiguration other)
-
-