Este conteúdo não está disponível no idioma selecionado.
5.3. Clustered Modes
Red Hat JBoss Data Grid offers the following clustered modes:
- Replication Mode replicates any entry that is added across all cache instances in the cluster.
- Invalidation Mode does not share any data, but signals remote caches to initiate the removal of invalid entries.
- Distribution Mode stores each entry on a subset of nodes instead of on all nodes in the cluster.
The clustered modes can be further configured to use synchronous or asynchronous transport for network communications.
5.3.1. Asynchronous and Synchronous Operations Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
When a clustered mode (such as invalidation, replication or distribution) is used, data is propagated to other nodes in either a synchronous or asynchronous manner.
If synchronous mode is used, the sender waits for responses from receivers before allowing the thread to continue, whereas asynchronous mode transmits data but does not wait for responses from other nodes in the cluster to continue operations.
Asynchronous mode prioritizes speed over consistency, which is ideal for use cases such as HTTP session replications with sticky sessions enabled. Such a session (or data for other use cases) is always accessed on the same cluster node, unless this node fails.
5.3.2. About Asynchronous Communications Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
In Red Hat JBoss Data Grid, the local, distributed and replicated modes are represented by the
local-cache
, distributed-cache
and replicated-cache
elements respectively. Each of these elements contains a mode
property, the value of which can be set to SYNC
for synchronous or ASYNC
for asynchronous communications.
Example 5.1. Asynchronous Communications Example Configuration
Note
This configuration is valid for both JBoss Data Grid's usage modes (Library mode and Remote Client-Server mode).
5.3.3. Cache Mode Troubleshooting Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
5.3.3.1. Invalid Data in ReadExternal Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
If invalid data is passed to
readExternal
, it can be because when using Cache.putAsync()
, starting serialization can cause your object to be modified, causing the datastream passed to readExternal
to be corrupted. This can be resolved if access to the object is synchronized.
5.3.3.2. Cluster Physical Address Retrieval Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
How can the physical addresses of the cluster be retrieved?
The physical address can be retrieved using an instance method call. For example: AdvancedCache.getRpcManager().getTransport().getPhysicalAddresses()
.