5.6. Configure Distribution Mode (Library Mode)
In JBoss Data Grid's Library mode, a distributed cache configuration is as follows:
The
clustering element's mode parameter's value determines the clustering mode selected for the cache.
The
sync element's replTimeout parameter specifies the maximum time period for an acknowledgment after a remote call. If the time period ends without any acknowledgment, an exception is thrown.
The
stateTransfer element specifies how state is transferred when a node leaves or joins the cluster. It uses the following parameters:
- The
chunkSizeparameter specifies the size of cache entry state batches to be transferred. If this value is greater than0, the value set is the size of chunks sent. If the value is less than0, all states are transferred at the same time. - The
fetchMemoryInStateparameter when set totrue, requests state information from neighboring caches on start up. This impacts the start up time for the cache. - The
awaitInitialTransferparameter causes 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 (iffetchInMemoryStateis enabled). This option applies to distributed and replicated caches only and is enabled by default. - The
timeoutparameter specifies the maximum time (in milliseconds) the cache waits for responses from neighboring caches with the requested states. If no response is received within the thetimeoutperiod, the start up process aborts and an exception is thrown.
The
transport element defines the transport configuration for the cache as follows:
- The
clusterNameparameter specifies the name of the cluster. Nodes can only connect to clusters that share the same name. - The
distributedSyncTimeoutparameter specifies the time to wait to acquire a lock on the distributed lock. This distributed lock ensures that a single cache can transfer state or rehash state at a time. - The
strictPeerToPeerparameter, when set totrueensures that replication operations fail if the named cache does not exist. If set tofalse, the operation completes and logs messages about specific named caches not found and that replication was not performed on the nodes as a result. - The
transportClassparameter specifies a class that represents a network transport for the cache.