Class HashConfigurationBuilder
- java.lang.Object
-
- org.infinispan.configuration.cache.HashConfigurationBuilder
-
- All Implemented Interfaces:
Builder<HashConfiguration>,ClusteringConfigurationChildBuilder,ConfigurationChildBuilder
public class HashConfigurationBuilder extends Object implements Builder<HashConfiguration>
Allows fine-tuning of rehashing characteristics. Must only used with 'distributed' cache mode.- Author:
- pmuir
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationBuilderbuilder
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.configuration.cache.ConfigurationChildBuilder
build, clustering, compatibility, customInterceptors, dataContainer, deadlockDetection, encoding, eviction, expiration, indexing, invocationBatching, jmxStatistics, locking, memory, persistence, security, simpleCache, simpleCache, sites, storeAsBinary, template, transaction, unsafe, versioning
-
-
-
-
Field Detail
-
builder
protected final ConfigurationBuilder builder
-
-
Method Detail
-
consistentHash
@Deprecated public HashConfigurationBuilder consistentHash(ConsistentHash consistentHash)
Deprecated.Since 5.2, replaced byconsistentHashFactory(ConsistentHashFactory).
-
consistentHashFactory
public HashConfigurationBuilder consistentHashFactory(ConsistentHashFactory<? extends ConsistentHash> consistentHashFactory)
The consistent hash factory in use.
-
numOwners
public HashConfigurationBuilder numOwners(int numOwners)
Number of cluster-wide replicas for each cache entry.
-
numVirtualNodes
@Deprecated public HashConfigurationBuilder numVirtualNodes(int numVirtualNodes)
Deprecated.No longer used since 5.2, replaced bynumSegments(int)(which works like anumVirtualNodesvalue for the entire cluster).
-
numSegments
public HashConfigurationBuilder numSegments(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.- Parameters:
numSegments- the number of hash space segments. Must be strictly positive.
-
rehashEnabled
@Deprecated public HashConfigurationBuilder rehashEnabled()
Deprecated.Enable rebalancing and rehashing, which will take place when a new node joins the cluster or a node leaves
-
rehashEnabled
@Deprecated public HashConfigurationBuilder rehashEnabled(boolean enabled)
Deprecated.Enable rebalancing and rehashing, which will take place when a new node joins the cluster or a node leaves
-
rehashDisabled
@Deprecated public HashConfigurationBuilder rehashDisabled()
Deprecated.Disable rebalancing and rehashing, which would have taken place when a new node joins the cluster or a node leaves
-
rehashRpcTimeout
@Deprecated public HashConfigurationBuilder rehashRpcTimeout(long rehashRpcTimeout)
Deprecated.UseStateTransferConfigurationBuilder.timeout(long)instead.Rehashing timeout
-
rehashWait
@Deprecated public HashConfigurationBuilder rehashWait(long rehashWait)
Deprecated.No longer used.
-
hash
@Deprecated public HashConfigurationBuilder hash(Hash hash)
Deprecated.Since 8.2, usekeyPartitioner(KeyPartitioner)instead.The hash function in use. Used as a bit spreader and a general hash code generator. Typically used in conjunction with the many defaultConsistentHashimplementations 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.0
-
capacityFactor
public HashConfigurationBuilder capacityFactor(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.- Parameters:
capacityFactor- the capacity factor for the local node. Must be positive.
-
keyPartitioner
public HashConfigurationBuilder keyPartitioner(KeyPartitioner keyPartitioner)
Key partitioner, controlling the mapping of keys to hash segments.The default implementation
org.infinispan.distribution.ch.impl.HashFunctionPartitioner, uses the hash function configured viahash(Hash). Future versions may ignore the hash function.- Since:
- 8.2
-
groups
public GroupsConfigurationBuilder groups()
-
validate
public void validate()
Description copied from interface:BuilderValidate the data in this builder before building the configuration bean- Specified by:
validatein interfaceBuilder<HashConfiguration>
-
validate
public void validate(GlobalConfiguration globalConfig)
- Specified by:
validatein interfaceConfigurationChildBuilder
-
create
public HashConfiguration create()
Description copied from interface:BuilderCreate the configuration bean- Specified by:
createin interfaceBuilder<HashConfiguration>- Returns:
-
read
public HashConfigurationBuilder read(HashConfiguration template)
Description copied from interface:BuilderReads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
readin interfaceBuilder<HashConfiguration>- Parameters:
template- the configuration from which to "clone" this config if needed.
-
hash
public HashConfigurationBuilder hash()
Description copied from interface:ClusteringConfigurationChildBuilderAllows fine-tuning of rehashing characteristics. Must only used with 'distributed' cache mode.- Specified by:
hashin interfaceClusteringConfigurationChildBuilder
-
l1
public L1ConfigurationBuilder l1()
Description copied from interface:ClusteringConfigurationChildBuilderConfigures the L1 cache behavior in 'distributed' caches instances. In any other cache modes, this element is ignored.- Specified by:
l1in interfaceClusteringConfigurationChildBuilder
-
stateTransfer
public StateTransferConfigurationBuilder stateTransfer()
Description copied from interface:ClusteringConfigurationChildBuilderConfigures how state is transferred when a new cache joins the cluster. Used with distribution and replication clustered modes.- Specified by:
stateTransferin interfaceClusteringConfigurationChildBuilder
-
sync
public SyncConfigurationBuilder sync()
Description copied from interface:ClusteringConfigurationChildBuilderIf configured all communications are synchronous, in that whenever a thread sends a message sent over the wire, it blocks until it receives an acknowledgment from the recipient. SyncConfig is mutually exclusive with the AsyncConfig.- Specified by:
syncin interfaceClusteringConfigurationChildBuilder
-
partitionHandling
public PartitionHandlingConfigurationBuilder partitionHandling()
Description copied from interface:ClusteringConfigurationChildBuilderConfigures how the cache will react to cluster partitions.- Specified by:
partitionHandlingin interfaceClusteringConfigurationChildBuilder
-
getClusteringBuilder
protected ClusteringConfigurationBuilder getClusteringBuilder()
-
template
public ConfigurationChildBuilder template(boolean template)
- Specified by:
templatein interfaceConfigurationChildBuilder
-
simpleCache
public ConfigurationChildBuilder simpleCache(boolean simpleCache)
- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()
- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
clustering
public ClusteringConfigurationBuilder clustering()
- Specified by:
clusteringin interfaceConfigurationChildBuilder
-
customInterceptors
public CustomInterceptorsConfigurationBuilder customInterceptors()
- Specified by:
customInterceptorsin interfaceConfigurationChildBuilder
-
dataContainer
public DataContainerConfigurationBuilder dataContainer()
- Specified by:
dataContainerin interfaceConfigurationChildBuilder
-
deadlockDetection
public DeadlockDetectionConfigurationBuilder deadlockDetection()
- Specified by:
deadlockDetectionin interfaceConfigurationChildBuilder
-
encoding
public EncodingConfigurationBuilder encoding()
- Specified by:
encodingin interfaceConfigurationChildBuilder
-
eviction
public EvictionConfigurationBuilder eviction()
- Specified by:
evictionin interfaceConfigurationChildBuilder
-
expiration
public ExpirationConfigurationBuilder expiration()
- Specified by:
expirationin interfaceConfigurationChildBuilder
-
indexing
public IndexingConfigurationBuilder indexing()
- Specified by:
indexingin interfaceConfigurationChildBuilder
-
invocationBatching
public InvocationBatchingConfigurationBuilder invocationBatching()
- Specified by:
invocationBatchingin interfaceConfigurationChildBuilder
-
jmxStatistics
public JMXStatisticsConfigurationBuilder jmxStatistics()
- Specified by:
jmxStatisticsin interfaceConfigurationChildBuilder
-
persistence
public PersistenceConfigurationBuilder persistence()
- Specified by:
persistencein interfaceConfigurationChildBuilder
-
locking
public LockingConfigurationBuilder locking()
- Specified by:
lockingin interfaceConfigurationChildBuilder
-
security
public SecurityConfigurationBuilder security()
- Specified by:
securityin interfaceConfigurationChildBuilder
-
storeAsBinary
@Deprecated public StoreAsBinaryConfigurationBuilder storeAsBinary()
Deprecated.- Specified by:
storeAsBinaryin interfaceConfigurationChildBuilder
-
transaction
public TransactionConfigurationBuilder transaction()
- Specified by:
transactionin interfaceConfigurationChildBuilder
-
versioning
public VersioningConfigurationBuilder versioning()
- Specified by:
versioningin interfaceConfigurationChildBuilder
-
unsafe
public UnsafeConfigurationBuilder unsafe()
- Specified by:
unsafein interfaceConfigurationChildBuilder
-
sites
public SitesConfigurationBuilder sites()
- Specified by:
sitesin interfaceConfigurationChildBuilder
-
compatibility
@Deprecated public CompatibilityModeConfigurationBuilder compatibility()
Deprecated.- Specified by:
compatibilityin interfaceConfigurationChildBuilder
-
memory
public MemoryConfigurationBuilder memory()
- Specified by:
memoryin interfaceConfigurationChildBuilder
-
getBuilder
protected ConfigurationBuilder getBuilder()
-
build
public Configuration build()
- Specified by:
buildin interfaceConfigurationChildBuilder
-
-