public class HashConfiguration extends java.lang.Object implements Matchable<HashConfiguration>
| Modifier and Type | Field and Description |
|---|---|
static AttributeDefinition<java.lang.Float> |
CAPACITY_FACTOR |
static AttributeDefinition<ConsistentHashFactory> |
CONSISTENT_HASH_FACTORY |
static AttributeDefinition<Hash> |
HASH |
static AttributeDefinition<KeyPartitioner> |
KEY_PARTITIONER |
static AttributeDefinition<java.lang.Integer> |
NUM_OWNERS |
static AttributeDefinition<java.lang.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.
|
ConsistentHash |
consistentHash()
Deprecated.
Since 5.2, replaced by
consistentHashFactory(). |
ConsistentHashFactory<?> |
consistentHashFactory()
The consistent hash factory in use.
|
boolean |
equals(java.lang.Object obj) |
GroupsConfiguration |
groups()
Configuration for various grouper definitions.
|
Hash |
hash()
Deprecated.
Since 8.2, use
keyPartitioner() instead. |
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).
|
boolean |
rehashEnabled()
Deprecated.
Use
StateTransferConfiguration.fetchInMemoryState() instead. |
long |
rehashRpcTimeout()
Deprecated.
Use
StateTransferConfiguration.timeout() instead. |
long |
rehashWait()
Deprecated.
Use
StateTransferConfiguration.timeout() instead. |
java.lang.String |
toString() |
public static final AttributeDefinition<ConsistentHashFactory> CONSISTENT_HASH_FACTORY
public static final AttributeDefinition<Hash> HASH
public static final AttributeDefinition<java.lang.Integer> NUM_OWNERS
public static final AttributeDefinition<java.lang.Integer> NUM_SEGMENTS
public static final AttributeDefinition<java.lang.Float> CAPACITY_FACTOR
public static final AttributeDefinition<KeyPartitioner> KEY_PARTITIONER
@Deprecated public ConsistentHash consistentHash()
consistentHashFactory().public ConsistentHashFactory<?> consistentHashFactory()
@Deprecated public Hash hash()
keyPartitioner() instead.ConsistentHash
implementations shipped.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, larger
numSegments values 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 keeping numSegments <= 10 * clusterSize.
@Deprecated public boolean rehashEnabled()
StateTransferConfiguration.fetchInMemoryState() instead.@Deprecated public long rehashRpcTimeout()
StateTransferConfiguration.timeout() instead.@Deprecated public long rehashWait()
StateTransferConfiguration.timeout() instead.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()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean matches(HashConfiguration other)
matches in interface Matchable<HashConfiguration>