public class HashConfiguration extends Object implements Matchable<HashConfiguration>, ConfigurationInfo
Modifier and Type | Field and Description |
---|---|
static AttributeDefinition<Float> |
CAPACITY_FACTOR |
static AttributeDefinition<ConsistentHashFactory> |
CONSISTENT_HASH_FACTORY |
static ElementDefinition |
ELEMENT_DEFINITION |
static AttributeDefinition<KeyPartitioner> |
KEY_PARTITIONER |
static AttributeDefinition<Integer> |
NUM_OWNERS |
static AttributeDefinition<Integer> |
NUM_SEGMENTS |
Modifier and Type | Method and Description |
---|---|
AttributeSet |
attributes() |
float |
capacityFactor()
Controls the proportion of entries that will reside on the local node, compared to the other nodes in the
cluster.
|
ConsistentHashFactory<?> |
consistentHashFactory()
Deprecated.
Since 11.0. Will be removed in 14.0, the segment allocation will no longer be customizable.
|
boolean |
equals(Object obj) |
ElementDefinition |
getElementDefinition() |
GroupsConfiguration |
groups()
Configuration for various grouper definitions.
|
int |
hashCode() |
KeyPartitioner |
keyPartitioner() |
boolean |
matches(HashConfiguration other) |
int |
numOwners()
Number of cluster-wide replicas for each cache entry.
|
int |
numSegments()
Controls the total number of hash space segments (per cluster).
|
List<ConfigurationInfo> |
subElements() |
String |
toString() |
public static final AttributeDefinition<ConsistentHashFactory> CONSISTENT_HASH_FACTORY
public static final AttributeDefinition<Integer> NUM_OWNERS
public static final AttributeDefinition<Integer> NUM_SEGMENTS
public static final AttributeDefinition<Float> CAPACITY_FACTOR
public static final AttributeDefinition<KeyPartitioner> KEY_PARTITIONER
public static final ElementDefinition ELEMENT_DEFINITION
@Deprecated public ConsistentHashFactory<?> consistentHashFactory()
public int numOwners()
public int numSegments()
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.
public float capacityFactor()
2
will
have twice as many entries as a node with a capacity factor of 1
.public KeyPartitioner keyPartitioner()
public GroupsConfiguration groups()
public AttributeSet attributes()
attributes
in interface BaseConfigurationInfo
AttributeSet
declared by the configuration.public ElementDefinition getElementDefinition()
getElementDefinition
in interface BaseConfigurationInfo
ElementDefinition
of the configuration.public List<ConfigurationInfo> subElements()
subElements
in interface ConfigurationInfo
public boolean matches(HashConfiguration other)
matches
in interface Matchable<HashConfiguration>
Copyright © 2021 JBoss by Red Hat. All rights reserved.