public class HashConfigurationBuilder extends AbstractClusteringConfigurationChildBuilder implements Builder<HashConfiguration>
Modifier and Type | Field and Description |
---|---|
private float |
capacityFactor |
private org.infinispan.distribution.ch.ConsistentHashFactory |
consistentHashFactory |
private GroupsConfigurationBuilder |
groupsConfigurationBuilder |
private Hash |
hash |
private static org.infinispan.util.logging.Log |
log |
private int |
numOwners |
private int |
numSegments |
Constructor and Description |
---|
HashConfigurationBuilder(ClusteringConfigurationBuilder builder) |
Modifier and Type | Method and Description |
---|---|
HashConfigurationBuilder |
capacityFactor(float capacityFactor)
Controls the proportion of entries that will reside on the local node, compared to the other nodes in the
cluster.
|
HashConfigurationBuilder |
consistentHash(org.infinispan.distribution.ch.ConsistentHash consistentHash)
Deprecated.
Since 5.2, replaced by
consistentHashFactory(ConsistentHashFactory) . |
HashConfigurationBuilder |
consistentHashFactory(org.infinispan.distribution.ch.ConsistentHashFactory consistentHashFactory)
The consistent hash factory in use.
|
HashConfiguration |
create()
Create the configuration bean
|
GroupsConfigurationBuilder |
groups() |
HashConfigurationBuilder |
hash(Hash hash)
The hash function in use.
|
HashConfigurationBuilder |
numOwners(int numOwners)
Number of cluster-wide replicas for each cache entry.
|
HashConfigurationBuilder |
numSegments(int numSegments)
Controls the total number of hash space segments (per cluster).
|
HashConfigurationBuilder |
numVirtualNodes(int numVirtualNodes)
Deprecated.
No longer used since 5.2, replaced by
numSegments(int) (which works like a
numVirtualNodes value for the entire cluster). |
HashConfigurationBuilder |
read(HashConfiguration template)
Reads the configuration from an already created configuration bean into this builder.
|
HashConfigurationBuilder |
rehashDisabled()
Deprecated.
|
HashConfigurationBuilder |
rehashEnabled()
Deprecated.
|
HashConfigurationBuilder |
rehashEnabled(boolean enabled)
Deprecated.
|
HashConfigurationBuilder |
rehashRpcTimeout(long rehashRpcTimeout)
Deprecated.
Use
StateTransferConfigurationBuilder.timeout(long) instead. |
HashConfigurationBuilder |
rehashWait(long rehashWait)
Deprecated.
No longer used.
|
java.lang.String |
toString() |
void |
validate()
Validate the data in this builder before building the configuration bean
|
async, getClusteringBuilder, hash, l1, stateTransfer, sync
build, clustering, compatibility, customInterceptors, dataContainer, deadlockDetection, eviction, expiration, getBuilder, indexing, invocationBatching, jmxStatistics, locking, persistence, security, sites, storeAsBinary, transaction, unsafe, versioning
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
build, clustering, compatibility, customInterceptors, dataContainer, deadlockDetection, eviction, expiration, indexing, invocationBatching, jmxStatistics, locking, persistence, security, sites, storeAsBinary, transaction, unsafe, versioning
private static final org.infinispan.util.logging.Log log
private org.infinispan.distribution.ch.ConsistentHashFactory consistentHashFactory
private Hash hash
private int numOwners
private int numSegments
private float capacityFactor
private final GroupsConfigurationBuilder groupsConfigurationBuilder
HashConfigurationBuilder(ClusteringConfigurationBuilder builder)
@Deprecated public HashConfigurationBuilder consistentHash(org.infinispan.distribution.ch.ConsistentHash consistentHash)
consistentHashFactory(ConsistentHashFactory)
.public HashConfigurationBuilder consistentHashFactory(org.infinispan.distribution.ch.ConsistentHashFactory consistentHashFactory)
public HashConfigurationBuilder numOwners(int numOwners)
@Deprecated public HashConfigurationBuilder numVirtualNodes(int numVirtualNodes)
numSegments(int)
(which works like a
numVirtualNodes
value for the entire cluster).public HashConfigurationBuilder numSegments(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
.
numSegments
- the number of hash space segments. Must be strictly positive.@Deprecated public HashConfigurationBuilder rehashEnabled()
StateTransferConfigurationBuilder.fetchInMemoryState(boolean)
instead.@Deprecated public HashConfigurationBuilder rehashEnabled(boolean enabled)
StateTransferConfigurationBuilder.fetchInMemoryState(boolean)
instead.@Deprecated public HashConfigurationBuilder rehashDisabled()
StateTransferConfigurationBuilder.fetchInMemoryState(boolean)
instead.@Deprecated public HashConfigurationBuilder rehashRpcTimeout(long rehashRpcTimeout)
StateTransferConfigurationBuilder.timeout(long)
instead.@Deprecated public HashConfigurationBuilder rehashWait(long rehashWait)
public HashConfigurationBuilder hash(Hash hash)
ConsistentHash
implementations shipped.
NOTE: Currently Infinispan will not use the object instance, but instead instantiate a new
instance of the class. Therefore, do not expect any state to survive, and provide a no-args
constructor to any instance. This will be resolved in Infinispan 5.2.0public HashConfigurationBuilder capacityFactor(float capacityFactor)
2
will
have twice as many entries as a node with a capacity factor of 1
.capacityFactor
- the capacity factor for the local node. Must be positive.public GroupsConfigurationBuilder groups()
public void validate()
Builder
validate
in interface Builder<HashConfiguration>
public HashConfiguration create()
Builder
create
in interface Builder<HashConfiguration>
public HashConfigurationBuilder read(HashConfiguration template)
Builder
read
in interface Builder<HashConfiguration>
template
- the configuration from which to "clone" this config if needed.public java.lang.String toString()
toString
in class java.lang.Object