public interface GridDr
DR is a process of transferring updates from a cache located in one topology to a cache located in another topology. Usual use case for DR is synchronizing cache state between several geographically remote topologies through WAN.
DR operates on the following terms:
GridGainCacheConfiguration.getDrSenderConfiguration()
, and it is
considered as receiver cache in case GridGainCacheConfiguration.isDrReceiverEnabled()
is true
.
Node is considered as sender hub in case it has GridGainConfiguration.getDrSenderConfiguration()
,
and it is considered as receiver hub in case it has
GridGainConfiguration.getDrReceiverConfiguration()
.
Particular cache can be both sender and receiver at the same time. Particular node can be both sender and receiver hub and host sender/receiver caches at the same time.
This API provides ability to manage DR process on sender cache node as well as get metrics for sender cache, receiver cache, sender hub and receiver hub.
Modifier and Type | Method and Description |
---|---|
IgniteFuture<?> |
cancelStateTransfer(IgniteUuid taskUuid)
Cancel state transfer operation with given uid.
|
IgniteFuture<?> |
flush(String cacheName)
Flushes DR updates.
|
IgniteFuture<?> |
incrementalStateTransfer(String cacheName,
long snapshotId,
byte dataCenterId)
Starts incremental state transfer for given cache.
|
boolean |
isLocalSender()
Checks whether current node is sender.
|
Collection<CacheDrStateTransfer> |
listStateTransfers()
List all currently active state transfers.
|
Collection<CacheDrStateTransfer> |
listStateTransfers(String cacheName)
List all currently active state transfer for the given sender cache.
|
DrSender |
localSender()
Gets sender facade for current node.
|
void |
pause(String cacheName)
Deprecated.
This method actually works same way as
stopReplication(String) and
stops replication for given cache. |
DrReceiverInMetrics |
receiverAggregatedInMetrics()
Gets receiver hub incoming data metrics aggregated across all remote data centers and cache names.
|
DrReceiverInMetrics |
receiverAggregatedInMetrics(byte srcDataCenterId)
Gets receiver hub incoming data metrics aggregated across all cache names for the given remote data center.
|
DrReceiverInMetrics |
receiverAggregatedInMetrics(String cacheName)
Gets receiver hub incoming data metrics aggregated across all remote data centers for the given cache name.
|
DrReceiverOutMetrics |
receiverAggregatedOutMetrics()
Gets receiver hub outgoing data metrics aggregated across all receiver caches.
|
CacheDrReceiverMetrics |
receiverCacheMetrics(String cacheName)
Gets receiver cache metrics.
|
DrReceiverInMetrics |
receiverInMetrics(byte srcDataCenterId,
String cacheName)
Gets receiver hub incoming data metrics for the given remote data center and cache name.
|
DrReceiverOutMetrics |
receiverOutMetrics(byte srcDataCenterId,
String cacheName)
Gets receiver hub outgoing data metrics for the given source data center id and cache name.
|
DrReceiverOutMetrics |
receiverOutMetrics(String cacheName)
Gets receiver hub outgoing data metrics for the given cache name.
|
void |
resetMetrics()
Reset all sender hub and receiver hub metrics on this node.
|
void |
resume(String cacheName)
Deprecated.
This method actually works same way as
startReplication(String) and
starts replication for given cache. |
DrSenderInMetrics |
senderAggregatedInMetrics()
Gets sender hub incoming data metrics aggregated across all caches.
|
DrSenderOutMetrics |
senderAggregatedOutMetrics()
Gets sender hub outgoing data metrics aggregated across all remote data centers and cache names.
|
DrSenderOutMetrics |
senderAggregatedOutMetrics(byte destDataCenterId)
Gets sender hub outgoing data metrics aggregated across all cache names for the given remote data center ID.
|
DrSenderOutMetrics |
senderAggregatedOutMetrics(String cacheName)
Gets sender hub outgoing data metrics aggregated across all remote data centers for the given cache name.
|
CacheDrSenderMetrics |
senderCacheMetrics(String cacheName)
Gets sender cache metrics.
|
CacheDrStatus |
senderCacheStatus(String cacheName)
Gets data center replication status for particular sender cache.
|
DrSenderInMetrics |
senderInMetrics(String cacheName)
Gets sender hub incoming data metrics for specified sender cache.
|
DrSenderOutMetrics |
senderOutMetrics(byte destDataCenterId,
String cacheName)
Gets sender hub outgoing data metrics for the given remote data center ID and cache name.
|
void |
startReplication(String cacheName)
Starts data center replication for particular sender cache.
|
IgniteFuture<?> |
stateTransfer(String cacheName,
boolean sync,
byte... dataCenterIds)
Starts full state transfer for the given sender cache.
|
IgniteFuture<?> |
stateTransfer(String cacheName,
byte... dataCenterIds)
Starts full state transfer for the given sender cache.
|
void |
stopReplication(String cacheName)
Stops data center replication for particular sender cache.
|
IgniteFuture<?> stateTransfer(String cacheName, byte... dataCenterIds)
In case node doesn't have cache with the given name or this cache is not sender cache, an exception will be thrown.
Only one state transfer for particular cache and data center is allowed at a time. In case another state transfer for the given cache and data center had been already in progress when this method was called, then no new state transfer for this (cache name, data center) pair will be initiated and returned future will "join" existing state transfer.
cacheName
- Sender cache name.dataCenterIds
- Remote data center IDs for which full state transfer was requested.IllegalArgumentException
- If node doesn't have cache
with the given name.IllegalArgumentException
- if this cache is not sender cache or
grid is stopping.IgniteFuture<?> stateTransfer(String cacheName, boolean sync, byte... dataCenterIds)
In case node doesn't have cache with the given name or this cache is not sender cache, an exception will be thrown.
Only one state transfer for particular cache and data center is allowed at a time. In case another state transfer for the given cache and data center had been already in progress when this method was called, then no new state transfer for this (cache name, data center) pair will be initiated and returned future will "join" existing state transfer.
Synchronous state transfer future is completed when the remote data center confirms it has received all the data. Asynchronous state transfer future is completed when all data is delivered to the sender node (in the same DC).
In case node doesn't have cache with the given name then IllegalArgumentException
will be thrown, and if
this cache is not sender cache or grid is stopping then IllegalStateException
will be thrown.
cacheName
- Sender cache name.sync
- Sync mode flag. Setting this to True
force synchronous state transfer mode, otherwise async
mode will be used.dataCenterIds
- Remote data center IDs for which full state transfer was requested.IgniteFuture<?> incrementalStateTransfer(String cacheName, long snapshotId, byte dataCenterId)
stateTransfer(String, boolean, byte...)
for details.
The main differences are
cacheName
- Cache name.snapshotId
- Snapshot ID for which incremental state transfer is requested.dataCenterId
- Remote data center ID for which incremental state transfer is requested.IgniteFuture<?> cancelStateTransfer(IgniteUuid taskUuid)
taskUuid
- State transfer operation uid. See CacheDrStateTransfer.id()
.Collection<CacheDrStateTransfer> listStateTransfers(String cacheName)
In case node doesn't have cache with the given name then IllegalArgumentException
will be thrown, and if this cache is not sender cache or grid is stopping then IllegalStateException
will be thrown.
cacheName
- Cache name.Collection<CacheDrStateTransfer> listStateTransfers()
@Deprecated void pause(String cacheName)
stopReplication(String)
and
stops replication for given cache.
In case node doesn't have cache with the given name then IllegalArgumentException
will be thrown, and if this cache is not sender cache or grid is stopping then IllegalStateException
will be thrown.
cacheName
- Sender cache name.void stopReplication(String cacheName)
In case node doesn't have cache with the given name then IllegalArgumentException
will be thrown, and if this cache is not sender cache or grid is stopping then IllegalStateException
will be thrown.
cacheName
- Sender cache name.@Deprecated void resume(String cacheName)
startReplication(String)
and
starts replication for given cache.
In case node doesn't have cache with the given name then IllegalArgumentException
will be thrown, and if this cache is not sender cache or grid is stopping then IllegalStateException
will be thrown.
cacheName
- Sender cache name.void startReplication(String cacheName)
In case node doesn't have cache with the given name then IllegalArgumentException
will be thrown, and if this cache is not sender cache or grid is stopping then IllegalStateException
will be thrown.
cacheName
- Sender cache name.CacheDrStatus senderCacheStatus(String cacheName)
In case node doesn't have cache with the given name then IllegalArgumentException
will be thrown, and if this cache is not sender cache or grid is stopping then IllegalStateException
will be thrown.
cacheName
- Cache name.CacheDrSenderMetrics senderCacheMetrics(String cacheName)
In case node doesn't have cache with the given name then IllegalArgumentException
will be thrown, and if this cache is not sender cache then IllegalStateException
will be thrown.
cacheName
- Sender cache name.CacheDrReceiverMetrics receiverCacheMetrics(String cacheName)
In case node doesn't have cache with the given name then IllegalArgumentException
will be thrown, and if this cache is not receiver cache IllegalStateException
will be thrown.
cacheName
- Receiver cache name.DrSenderInMetrics senderInMetrics(String cacheName)
In case node is not sender hub then IllegalStateException
will be thrown.
If this sender hub does not work with the given cache IllegalArgumentException
will be thrown.
cacheName
- Sender cache name.DrSenderInMetrics senderAggregatedInMetrics()
In case node is not sender hub then IllegalStateException
will be thrown.
DrSenderOutMetrics senderOutMetrics(byte destDataCenterId, String cacheName)
In case node is not sender hub then IllegalStateException
will be thrown. If this sender hub does not
work with the given data center or cache IllegalArgumentException
will be thrown.
destDataCenterId
- Remote data center ID.cacheName
- Cache name.DrSenderOutMetrics senderAggregatedOutMetrics(byte destDataCenterId)
In case node is not sender hub then IllegalStateException
will be thrown. If this sender hub does not
work with the given data center IllegalArgumentException
will be thrown.
destDataCenterId
- Remote data center ID.DrSenderOutMetrics senderAggregatedOutMetrics(String cacheName)
In case node is not sender hub then IllegalStateException
will be thrown. If this sender hub does not
work with the given cache IllegalArgumentException
will be thrown.
cacheName
- Cache name.DrSenderOutMetrics senderAggregatedOutMetrics()
In case node is not sender hub then IllegalStateException
will be thrown.
DrReceiverInMetrics receiverInMetrics(byte srcDataCenterId, String cacheName)
In case node is not receiver hub then IllegalStateException
will be thrown.
srcDataCenterId
- Remote data center ID.cacheName
- Cache name.DrReceiverInMetrics receiverAggregatedInMetrics(byte srcDataCenterId)
In case node is not receiver hub then IllegalStateException
will be thrown.
srcDataCenterId
- Remote data center ID.DrReceiverInMetrics receiverAggregatedInMetrics(String cacheName)
In case node is not receiver hub then IllegalStateException
will be thrown.
cacheName
- Cache name.DrReceiverInMetrics receiverAggregatedInMetrics()
In case node is not receiver hub then IllegalStateException
will be thrown.
DrReceiverOutMetrics receiverOutMetrics(String cacheName)
In case node is not receiver hub then IllegalStateException
will be thrown.
cacheName
- Cache name.DrReceiverOutMetrics receiverOutMetrics(byte srcDataCenterId, String cacheName)
In case node is not receiver hub then IllegalStateException
will be thrown.
srcDataCenterId
- Remote data center ID.cacheName
- Cache name.DrReceiverOutMetrics receiverAggregatedOutMetrics()
In case node is not receiver hub then IllegalStateException
will be thrown.
void resetMetrics()
boolean isLocalSender()
True
if sender.DrSender localSender() throws IllegalStateException
IllegalStateException
- If current node is not sender.IgniteFuture<?> flush(String cacheName)
cacheName
- Cache name.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024