Class StateTransferConfigurationBuilder
- java.lang.Object
-
- org.infinispan.configuration.cache.StateTransferConfigurationBuilder
-
- All Implemented Interfaces:
org.infinispan.commons.configuration.BaseConfigurationInfo,org.infinispan.commons.configuration.Builder<StateTransferConfiguration>,org.infinispan.commons.configuration.ConfigurationBuilderInfo,ClusteringConfigurationChildBuilder,ConfigurationChildBuilder
public class StateTransferConfigurationBuilder extends Object implements org.infinispan.commons.configuration.Builder<StateTransferConfiguration>, org.infinispan.commons.configuration.ConfigurationBuilderInfo
Configures how state is transferred when a cache joins or leaves the cluster. Used in distributed and replication clustered modes.- Since:
- 5.1
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationBuilderbuilder
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.infinispan.commons.configuration.attributes.AttributeSetattributes()StateTransferConfigurationBuilderawaitInitialTransfer(boolean b)Iftrue, this will cause the first call to methodCacheManager.getCache()on the joiner node to block and wait until the joining is complete and the cache has finished receiving state from neighboring caches (if fetchInMemoryState is enabled).Configurationbuild()StateTransferConfigurationBuilderchunkSize(int i)The state will be transferred in batches ofchunkSizecache entries.ClusteringConfigurationBuilderclustering()StateTransferConfigurationcreate()CustomInterceptorsConfigurationBuildercustomInterceptors()Deprecated.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptorsEncodingConfigurationBuilderencoding()ExpirationConfigurationBuilderexpiration()StateTransferConfigurationBuilderfetchInMemoryState(boolean b)Iftrue, the cache will fetch data from the neighboring caches when it starts up, so the cache starts 'warm', although it will impact startup time.protected ConfigurationBuildergetBuilder()protected ClusteringConfigurationBuildergetClusteringBuilder()org.infinispan.commons.configuration.elements.ElementDefinitiongetElementDefinition()HashConfigurationBuilderhash()Allows fine-tuning of rehashing characteristics.IndexingConfigurationBuilderindexing()InvocationBatchingConfigurationBuilderinvocationBatching()L1ConfigurationBuilderl1()Configures the L1 cache behavior in 'distributed' caches instances.LockingConfigurationBuilderlocking()MemoryConfigurationBuildermemory()PartitionHandlingConfigurationBuilderpartitionHandling()Configures how the cache will react to cluster partitions.PersistenceConfigurationBuilderpersistence()StateTransferConfigurationBuilderread(StateTransferConfiguration template)SecurityConfigurationBuildersecurity()booleansimpleCache()ConfigurationChildBuildersimpleCache(boolean simpleCache)SitesConfigurationBuildersites()StateTransferConfigurationBuilderstateTransfer()Configures how state is transferred when a new cache joins the cluster.StatisticsConfigurationBuilderstatistics()ConfigurationChildBuildertemplate(boolean template)StateTransferConfigurationBuildertimeout(long l)This is the maximum amount of time - in milliseconds - to wait for state from neighboring caches, before throwing an exception and aborting startup.StateTransferConfigurationBuildertimeout(long l, TimeUnit unit)This is the maximum amount of time - in milliseconds - to wait for state from neighboring caches, before throwing an exception and aborting startup.StringtoString()TransactionConfigurationBuildertransaction()UnsafeConfigurationBuilderunsafe()voidvalidate()voidvalidate(GlobalConfiguration globalConfig)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.commons.configuration.ConfigurationBuilderInfo
getBuilderInfo, getChildrenInfo, getNewBuilderInfo
-
Methods inherited from interface org.infinispan.configuration.cache.ConfigurationChildBuilder
build, clustering, customInterceptors, encoding, expiration, indexing, invocationBatching, jmxStatistics, locking, memory, persistence, security, simpleCache, simpleCache, sites, statistics, template, transaction, unsafe
-
-
-
-
Field Detail
-
builder
protected final ConfigurationBuilder builder
-
-
Method Detail
-
attributes
public org.infinispan.commons.configuration.attributes.AttributeSet attributes()
- Specified by:
attributesin interfaceorg.infinispan.commons.configuration.BaseConfigurationInfo
-
getElementDefinition
public org.infinispan.commons.configuration.elements.ElementDefinition getElementDefinition()
- Specified by:
getElementDefinitionin interfaceorg.infinispan.commons.configuration.BaseConfigurationInfo
-
fetchInMemoryState
public StateTransferConfigurationBuilder fetchInMemoryState(boolean b)
Iftrue, the cache will fetch data from the neighboring caches when it starts up, so the cache starts 'warm', although it will impact startup time. In distributed mode, state is transferred between running caches as well, as the ownership of keys changes (e.g. because a cache left the cluster). Disabling this setting means a key will sometimes have less thannumOwnerowners.
-
awaitInitialTransfer
public StateTransferConfigurationBuilder awaitInitialTransfer(boolean b)
Iftrue, this will cause the first call to methodCacheManager.getCache()on the joiner node to block and wait until the joining is complete and the cache has finished receiving state from neighboring caches (if fetchInMemoryState is enabled). This option applies to distributed and replicated caches only and is enabled by default. Please note that setting this tofalsewill make the cache object available immediately but any access to keys that should be available locally but are not yet transferred will actually cause a (transparent) remote access. While this will not have any impact on the logic of your application it might impact performance.
-
chunkSize
public StateTransferConfigurationBuilder chunkSize(int i)
The state will be transferred in batches ofchunkSizecache entries. If chunkSize is equal to Integer.MAX_VALUE, the state will be transferred in all at once. Not recommended.
-
timeout
public StateTransferConfigurationBuilder timeout(long l)
This is the maximum amount of time - in milliseconds - to wait for state from neighboring caches, before throwing an exception and aborting startup.
-
timeout
public StateTransferConfigurationBuilder timeout(long l, TimeUnit unit)
This is the maximum amount of time - in milliseconds - to wait for state from neighboring caches, before throwing an exception and aborting startup.
-
validate
public void validate()
- Specified by:
validatein interfaceorg.infinispan.commons.configuration.Builder<StateTransferConfiguration>
-
validate
public void validate(GlobalConfiguration globalConfig)
- Specified by:
validatein interfaceConfigurationChildBuilder
-
create
public StateTransferConfiguration create()
- Specified by:
createin interfaceorg.infinispan.commons.configuration.Builder<StateTransferConfiguration>
-
read
public StateTransferConfigurationBuilder read(StateTransferConfiguration template)
- Specified by:
readin interfaceorg.infinispan.commons.configuration.Builder<StateTransferConfiguration>
-
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
-
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
@Deprecated public CustomInterceptorsConfigurationBuilder customInterceptors()
Deprecated.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptors- Specified by:
customInterceptorsin interfaceConfigurationChildBuilder
-
encoding
public EncodingConfigurationBuilder encoding()
- Specified by:
encodingin 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
-
statistics
public StatisticsConfigurationBuilder statistics()
- Specified by:
statisticsin 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
-
transaction
public TransactionConfigurationBuilder transaction()
- Specified by:
transactionin interfaceConfigurationChildBuilder
-
unsafe
public UnsafeConfigurationBuilder unsafe()
- Specified by:
unsafein interfaceConfigurationChildBuilder
-
sites
public SitesConfigurationBuilder sites()
- Specified by:
sitesin interfaceConfigurationChildBuilder
-
memory
public MemoryConfigurationBuilder memory()
- Specified by:
memoryin interfaceConfigurationChildBuilder
-
getBuilder
protected ConfigurationBuilder getBuilder()
-
build
public Configuration build()
- Specified by:
buildin interfaceConfigurationChildBuilder
-
-