public class HashConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
static AttributeDefinition<Float> |
CAPACITY_FACTOR |
static AttributeDefinition<ConsistentHashFactory> |
CONSISTENT_HASH_FACTORY |
static AttributeDefinition<Hash> |
HASH |
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.
|
ConsistentHash |
consistentHash()
Deprecated.
Since 5.2, replaced by
consistentHashFactory() . |
ConsistentHashFactory<?> |
consistentHashFactory()
The consistent hash factory in use.
|
boolean |
equals(Object obj) |
GroupsConfiguration |
groups()
Configuration for various grouper definitions.
|
Hash |
hash()
The hash function in use.
|
int |
hashCode() |
int |
numOwners()
Number of cluster-wide replicas for each cache entry.
|
int |
numSegments()
Controls the total number of hash space segments (per cluster).
|
int |
numVirtualNodes()
Deprecated.
No longer used since 5.2, replaced by
numSegments() (which works like a
numVirtualNodes value for the entire cluster). |
boolean |
rehashEnabled()
Deprecated.
Use
StateTransferConfiguration.fetchInMemoryState() instead. |
long |
rehashRpcTimeout()
Deprecated.
Use
StateTransferConfiguration.timeout() instead. |
long |
rehashWait()
Deprecated.
Use
StateTransferConfiguration.timeout() instead. |
String |
toString() |
public static final AttributeDefinition<ConsistentHashFactory> CONSISTENT_HASH_FACTORY
public static final AttributeDefinition<Hash> HASH
public static final AttributeDefinition<Integer> NUM_OWNERS
public static final AttributeDefinition<Integer> NUM_SEGMENTS
public static final AttributeDefinition<Float> CAPACITY_FACTOR
@Deprecated public ConsistentHash consistentHash()
consistentHashFactory()
.public ConsistentHashFactory<?> consistentHashFactory()
public Hash hash()
ConsistentHash
implementations shipped.public int numOwners()
@Deprecated public int numVirtualNodes()
numSegments()
(which works like a
numVirtualNodes
value for the entire cluster).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 GroupsConfiguration groups()
public AttributeSet attributes()
Copyright © 2015 JBoss, a division of Red Hat. All rights reserved.