Class StateTransferConfiguration
- java.lang.Object
-
- org.infinispan.configuration.cache.StateTransferConfiguration
-
- All Implemented Interfaces:
Matchable<StateTransferConfiguration>
,BaseConfigurationInfo
,ConfigurationInfo
public class StateTransferConfiguration extends java.lang.Object implements Matchable<StateTransferConfiguration>, ConfigurationInfo
Configures how state is retrieved when a new cache joins the cluster. Used with invalidation and replication clustered modes.- Since:
- 5.1
-
-
Field Summary
Fields Modifier and Type Field Description static AttributeDefinition<java.lang.Boolean>
AWAIT_INITIAL_TRANSFER
static AttributeDefinition<java.lang.Integer>
CHUNK_SIZE
static ElementDefinition
ELEMENT_DEFINITION
static AttributeDefinition<java.lang.Boolean>
FETCH_IN_MEMORY_STATE
static AttributeDefinition<java.lang.Long>
TIMEOUT
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeSet
attributes()
boolean
awaitInitialTransfer()
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).int
chunkSize()
The state will be transferred in batches ofchunkSize
cache entries.boolean
equals(java.lang.Object obj)
boolean
fetchInMemoryState()
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.ElementDefinition
getElementDefinition()
int
hashCode()
long
timeout()
This is the maximum amount of time - in milliseconds - to wait for state from neighboring caches, before throwing an exception and aborting startup.StateTransferConfiguration
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.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.commons.configuration.ConfigurationInfo
subElements
-
-
-
-
Field Detail
-
AWAIT_INITIAL_TRANSFER
public static final AttributeDefinition<java.lang.Boolean> AWAIT_INITIAL_TRANSFER
-
FETCH_IN_MEMORY_STATE
public static final AttributeDefinition<java.lang.Boolean> FETCH_IN_MEMORY_STATE
-
TIMEOUT
public static final AttributeDefinition<java.lang.Long> TIMEOUT
-
CHUNK_SIZE
public static final AttributeDefinition<java.lang.Integer> CHUNK_SIZE
-
ELEMENT_DEFINITION
public static final ElementDefinition ELEMENT_DEFINITION
-
-
Method Detail
-
fetchInMemoryState
public boolean fetchInMemoryState()
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.
-
timeout
public long timeout()
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 StateTransferConfiguration 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.
-
chunkSize
public int chunkSize()
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.
-
awaitInitialTransfer
public boolean awaitInitialTransfer()
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.
-
attributes
public AttributeSet attributes()
- Specified by:
attributes
in interfaceBaseConfigurationInfo
- Returns:
- the
AttributeSet
declared by the configuration.
-
getElementDefinition
public ElementDefinition getElementDefinition()
- Specified by:
getElementDefinition
in interfaceBaseConfigurationInfo
- Returns:
- the
ElementDefinition
of the configuration.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-