Class StateTransferConfigurationBuilder
- java.lang.Object
-
- org.infinispan.configuration.cache.StateTransferConfigurationBuilder
-
- All Implemented Interfaces:
BaseConfigurationInfo
,Builder<StateTransferConfiguration>
,ConfigurationBuilderInfo
,ClusteringConfigurationChildBuilder
,ConfigurationChildBuilder
public class StateTransferConfigurationBuilder extends Object implements Builder<StateTransferConfiguration>, 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 ConfigurationBuilder
builder
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.infinispan.commons.configuration.attributes.AttributeSet
attributes()
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).Configuration
build()
StateTransferConfigurationBuilder
chunkSize(int i)
The state will be transferred in batches ofchunkSize
cache entries.ClusteringConfigurationBuilder
clustering()
StateTransferConfiguration
create()
Create the configuration beanCustomInterceptorsConfigurationBuilder
customInterceptors()
Deprecated.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptorsEncodingConfigurationBuilder
encoding()
ExpirationConfigurationBuilder
expiration()
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.protected ConfigurationBuilder
getBuilder()
protected ClusteringConfigurationBuilder
getClusteringBuilder()
org.infinispan.commons.configuration.elements.ElementDefinition
getElementDefinition()
HashConfigurationBuilder
hash()
Allows fine-tuning of rehashing characteristics.IndexingConfigurationBuilder
indexing()
InvocationBatchingConfigurationBuilder
invocationBatching()
L1ConfigurationBuilder
l1()
Configures the L1 cache behavior in 'distributed' caches instances.LockingConfigurationBuilder
locking()
MemoryConfigurationBuilder
memory()
PartitionHandlingConfigurationBuilder
partitionHandling()
Configures how the cache will react to cluster partitions.PersistenceConfigurationBuilder
persistence()
StateTransferConfigurationBuilder
read(StateTransferConfiguration template)
Reads the configuration from an already created configuration bean into this builder.SecurityConfigurationBuilder
security()
boolean
simpleCache()
ConfigurationChildBuilder
simpleCache(boolean simpleCache)
SitesConfigurationBuilder
sites()
StateTransferConfigurationBuilder
stateTransfer()
Configures how state is transferred when a new cache joins the cluster.StatisticsConfigurationBuilder
statistics()
ConfigurationChildBuilder
template(boolean template)
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.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.String
toString()
TransactionConfigurationBuilder
transaction()
UnsafeConfigurationBuilder
unsafe()
void
validate()
Validate the data in this builder before building the configuration beanvoid
validate(GlobalConfiguration globalConfig)
-
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:
attributes
in interfaceBaseConfigurationInfo
- Returns:
- the
AttributeSet
declared by the configuration.
-
getElementDefinition
public org.infinispan.commons.configuration.elements.ElementDefinition getElementDefinition()
- Specified by:
getElementDefinition
in interfaceBaseConfigurationInfo
- Returns:
- the
ElementDefinition
of the configuration.
-
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 thannumOwner
owners.
-
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 tofalse
will 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 ofchunkSize
cache 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()
Description copied from interface:Builder
Validate the data in this builder before building the configuration bean- Specified by:
validate
in interfaceBuilder<StateTransferConfiguration>
-
validate
public void validate(GlobalConfiguration globalConfig)
- Specified by:
validate
in interfaceConfigurationChildBuilder
-
create
public StateTransferConfiguration create()
Description copied from interface:Builder
Create the configuration bean- Specified by:
create
in interfaceBuilder<StateTransferConfiguration>
- Returns:
-
read
public StateTransferConfigurationBuilder read(StateTransferConfiguration 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 interfaceBuilder<StateTransferConfiguration>
- Parameters:
template
- the configuration from which to "clone" this config if needed.
-
toString
public String toString()
-
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 interfaceClusteringConfigurationChildBuilder
-
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 interfaceClusteringConfigurationChildBuilder
-
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 interfaceClusteringConfigurationChildBuilder
-
partitionHandling
public PartitionHandlingConfigurationBuilder partitionHandling()
Description copied from interface:ClusteringConfigurationChildBuilder
Configures how the cache will react to cluster partitions.- Specified by:
partitionHandling
in interfaceClusteringConfigurationChildBuilder
-
getClusteringBuilder
protected ClusteringConfigurationBuilder getClusteringBuilder()
-
template
public ConfigurationChildBuilder template(boolean template)
- Specified by:
template
in interfaceConfigurationChildBuilder
-
simpleCache
public ConfigurationChildBuilder simpleCache(boolean simpleCache)
- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()
- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
clustering
public ClusteringConfigurationBuilder clustering()
- Specified by:
clustering
in 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:
customInterceptors
in interfaceConfigurationChildBuilder
-
encoding
public EncodingConfigurationBuilder encoding()
- Specified by:
encoding
in interfaceConfigurationChildBuilder
-
expiration
public ExpirationConfigurationBuilder expiration()
- Specified by:
expiration
in interfaceConfigurationChildBuilder
-
indexing
public IndexingConfigurationBuilder indexing()
- Specified by:
indexing
in interfaceConfigurationChildBuilder
-
invocationBatching
public InvocationBatchingConfigurationBuilder invocationBatching()
- Specified by:
invocationBatching
in interfaceConfigurationChildBuilder
-
statistics
public StatisticsConfigurationBuilder statistics()
- Specified by:
statistics
in interfaceConfigurationChildBuilder
-
persistence
public PersistenceConfigurationBuilder persistence()
- Specified by:
persistence
in interfaceConfigurationChildBuilder
-
locking
public LockingConfigurationBuilder locking()
- Specified by:
locking
in interfaceConfigurationChildBuilder
-
security
public SecurityConfigurationBuilder security()
- Specified by:
security
in interfaceConfigurationChildBuilder
-
transaction
public TransactionConfigurationBuilder transaction()
- Specified by:
transaction
in interfaceConfigurationChildBuilder
-
unsafe
public UnsafeConfigurationBuilder unsafe()
- Specified by:
unsafe
in interfaceConfigurationChildBuilder
-
sites
public SitesConfigurationBuilder sites()
- Specified by:
sites
in interfaceConfigurationChildBuilder
-
memory
public MemoryConfigurationBuilder memory()
- Specified by:
memory
in interfaceConfigurationChildBuilder
-
getBuilder
protected ConfigurationBuilder getBuilder()
-
build
public Configuration build()
- Specified by:
build
in interfaceConfigurationChildBuilder
-
-