org.infinispan.configuration.cache
Class HashConfigurationBuilder

java.lang.Object
  extended by 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

Method Summary
 AsyncConfigurationBuilder async()
          If configured all communications are asynchronous, in that whenever a thread sends a message sent over the wire, it does not wait for an acknowledgment before returning.
 Configuration build()
           
 ClusteringConfigurationBuilder clustering()
           
 CompatibilityModeConfigurationBuilder compatibility()
           
 HashConfigurationBuilder consistentHash(ConsistentHash consistentHash)
          Deprecated. Since 5.2, replaced by consistentHashFactory(ConsistentHashFactory).
 HashConfigurationBuilder consistentHashFactory(ConsistentHashFactory consistentHashFactory)
          The consistent hash factory in use.
 HashConfiguration create()
          Create the configuration bean
 CustomInterceptorsConfigurationBuilder customInterceptors()
           
 DataContainerConfigurationBuilder dataContainer()
           
 DeadlockDetectionConfigurationBuilder deadlockDetection()
           
 EvictionConfigurationBuilder eviction()
           
 ExpirationConfigurationBuilder expiration()
           
protected  ConfigurationBuilder getBuilder()
           
protected  ClusteringConfigurationBuilder getClusteringBuilder()
           
 GroupsConfigurationBuilder groups()
           
 HashConfigurationBuilder hash()
          Allows fine-tuning of rehashing characteristics.
 HashConfigurationBuilder hash(Hash hash)
          The hash function in use.
 IndexingConfigurationBuilder indexing()
           
 InvocationBatchingConfigurationBuilder invocationBatching()
           
 JMXStatisticsConfigurationBuilder jmxStatistics()
           
 L1ConfigurationBuilder l1()
          Configures the L1 cache behavior in 'distributed' caches instances.
 LoadersConfigurationBuilder loaders()
           
 LockingConfigurationBuilder locking()
           
 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. Use StateTransferConfigurationBuilder.fetchInMemoryState(boolean) instead.
 HashConfigurationBuilder rehashEnabled()
          Deprecated. Use StateTransferConfigurationBuilder.fetchInMemoryState(boolean) instead.
 HashConfigurationBuilder rehashEnabled(boolean enabled)
          Deprecated. Use StateTransferConfigurationBuilder.fetchInMemoryState(boolean) instead.
 HashConfigurationBuilder rehashRpcTimeout(long rehashRpcTimeout)
          Deprecated. Use StateTransferConfigurationBuilder.timeout(long) instead.
 HashConfigurationBuilder rehashWait(long rehashWait)
          Deprecated. No longer used.
 SitesConfigurationBuilder sites()
           
 StateTransferConfigurationBuilder stateTransfer()
          Configures how state is transferred when a new cache joins the cluster.
 StoreAsBinaryConfigurationBuilder storeAsBinary()
           
 SyncConfigurationBuilder sync()
          If 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.
 String toString()
           
 TransactionConfigurationBuilder transaction()
           
 UnsafeConfigurationBuilder unsafe()
           
 void validate()
          Validate the data in this builder before building the configuration bean
 VersioningConfigurationBuilder versioning()
           
 
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, eviction, expiration, indexing, invocationBatching, jmxStatistics, loaders, locking, sites, storeAsBinary, transaction, unsafe, versioning
 

Method Detail

consistentHash

@Deprecated
public HashConfigurationBuilder consistentHash(ConsistentHash consistentHash)
Deprecated. Since 5.2, replaced by consistentHashFactory(ConsistentHashFactory).


consistentHashFactory

public HashConfigurationBuilder consistentHashFactory(ConsistentHashFactory 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 by numSegments(int) (which works like a numVirtualNodes value 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 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.

Parameters:
numSegments - the number of hash space segments. Must be strictly positive.

rehashEnabled

@Deprecated
public HashConfigurationBuilder rehashEnabled()
Deprecated. Use StateTransferConfigurationBuilder.fetchInMemoryState(boolean) instead.

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. Use StateTransferConfigurationBuilder.fetchInMemoryState(boolean) instead.

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. Use StateTransferConfigurationBuilder.fetchInMemoryState(boolean) instead.

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. Use StateTransferConfigurationBuilder.timeout(long) instead.

Rehashing timeout


rehashWait

@Deprecated
public HashConfigurationBuilder rehashWait(long rehashWait)
Deprecated. No longer used.


hash

public HashConfigurationBuilder hash(Hash hash)
The hash function in use. Used as a bit spreader and a general hash code generator. Typically used in conjunction with the many default 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.0


groups

public GroupsConfigurationBuilder groups()

validate

public void validate()
Description copied from interface: Builder
Validate the data in this builder before building the configuration bean

Specified by:
validate in interface Builder<HashConfiguration>

create

public HashConfiguration create()
Description copied from interface: Builder
Create the configuration bean

Specified by:
create in interface Builder<HashConfiguration>
Returns:

read

public HashConfigurationBuilder read(HashConfiguration template)
Description copied from interface: Builder
Reads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration

Specified by:
read in interface Builder<HashConfiguration>
Parameters:
template - the configuration from which to "clone" this config if needed.

toString

public String toString()
Overrides:
toString in class Object

async

public AsyncConfigurationBuilder async()
Description copied from interface: ClusteringConfigurationChildBuilder
If configured all communications are asynchronous, in that whenever a thread sends a message sent over the wire, it does not wait for an acknowledgment before returning. Asynchronous configuration is mutually exclusive with synchronous configuration.

Specified by:
async in interface ClusteringConfigurationChildBuilder

hash

public HashConfigurationBuilder hash()
Description copied from interface: ClusteringConfigurationChildBuilder
Allows fine-tuning of rehashing characteristics. Must only used with 'distributed' cache mode.

Specified by:
hash in interface ClusteringConfigurationChildBuilder

l1

public L1ConfigurationBuilder l1()
Description copied from interface: ClusteringConfigurationChildBuilder
Configures the L1 cache behavior in 'distributed' caches instances. In any other cache modes, this element is ignored.

Specified by:
l1 in interface ClusteringConfigurationChildBuilder

stateTransfer

public StateTransferConfigurationBuilder stateTransfer()
Description copied from interface: ClusteringConfigurationChildBuilder
Configures how state is transferred when a new cache joins the cluster. Used with distribution and replication clustered modes.

Specified by:
stateTransfer in interface ClusteringConfigurationChildBuilder

sync

public SyncConfigurationBuilder sync()
Description copied from interface: ClusteringConfigurationChildBuilder
If 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:
sync in interface ClusteringConfigurationChildBuilder

getClusteringBuilder

protected ClusteringConfigurationBuilder getClusteringBuilder()

clustering

public ClusteringConfigurationBuilder clustering()
Specified by:
clustering in interface ConfigurationChildBuilder

customInterceptors

public CustomInterceptorsConfigurationBuilder customInterceptors()
Specified by:
customInterceptors in interface ConfigurationChildBuilder

dataContainer

public DataContainerConfigurationBuilder dataContainer()
Specified by:
dataContainer in interface ConfigurationChildBuilder

deadlockDetection

public DeadlockDetectionConfigurationBuilder deadlockDetection()
Specified by:
deadlockDetection in interface ConfigurationChildBuilder

eviction

public EvictionConfigurationBuilder eviction()
Specified by:
eviction in interface ConfigurationChildBuilder

expiration

public ExpirationConfigurationBuilder expiration()
Specified by:
expiration in interface ConfigurationChildBuilder

indexing

public IndexingConfigurationBuilder indexing()
Specified by:
indexing in interface ConfigurationChildBuilder

invocationBatching

public InvocationBatchingConfigurationBuilder invocationBatching()
Specified by:
invocationBatching in interface ConfigurationChildBuilder

jmxStatistics

public JMXStatisticsConfigurationBuilder jmxStatistics()
Specified by:
jmxStatistics in interface ConfigurationChildBuilder

loaders

public LoadersConfigurationBuilder loaders()
Specified by:
loaders in interface ConfigurationChildBuilder

locking

public LockingConfigurationBuilder locking()
Specified by:
locking in interface ConfigurationChildBuilder

storeAsBinary

public StoreAsBinaryConfigurationBuilder storeAsBinary()
Specified by:
storeAsBinary in interface ConfigurationChildBuilder

transaction

public TransactionConfigurationBuilder transaction()
Specified by:
transaction in interface ConfigurationChildBuilder

versioning

public VersioningConfigurationBuilder versioning()
Specified by:
versioning in interface ConfigurationChildBuilder

unsafe

public UnsafeConfigurationBuilder unsafe()
Specified by:
unsafe in interface ConfigurationChildBuilder

sites

public SitesConfigurationBuilder sites()
Specified by:
sites in interface ConfigurationChildBuilder

compatibility

public CompatibilityModeConfigurationBuilder compatibility()
Specified by:
compatibility in interface ConfigurationChildBuilder

getBuilder

protected ConfigurationBuilder getBuilder()

build

public Configuration build()
Specified by:
build in interface ConfigurationChildBuilder

-->

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.