Package org.infinispan.xsite
Class ClusteredCacheBackupReceiver
- java.lang.Object
-
- org.infinispan.xsite.ClusteredCacheBackupReceiver
-
- All Implemented Interfaces:
BackupReceiver
public class ClusteredCacheBackupReceiver extends Object implements BackupReceiver
BackupReceiverimplementation for clustered caches.- Since:
- 7.1
- Author:
- Pedro Ruivo
-
-
Constructor Summary
Constructors Constructor Description ClusteredCacheBackupReceiver(Configuration configuration, String cacheName)
-
Method Summary
-
-
-
Constructor Detail
-
ClusteredCacheBackupReceiver
public ClusteredCacheBackupReceiver(Configuration configuration, String cacheName)
-
-
Method Detail
-
start
public void start()
-
handleStartReceivingStateTransfer
public CompletionStage<Void> handleStartReceivingStateTransfer(XSiteStateTransferStartReceiveCommand command)
Description copied from interface:BackupReceiverIt handles starting the state transfer from a remote site. The command must be broadcast to the entire cluster in which the cache exists.- Specified by:
handleStartReceivingStateTransferin interfaceBackupReceiver
-
handleEndReceivingStateTransfer
public CompletionStage<Void> handleEndReceivingStateTransfer(XSiteStateTransferFinishReceiveCommand command)
Description copied from interface:BackupReceiverIt handles finishing the state transfer from a remote site. The command must be broadcast to the entire cluster in which the cache exists.- Specified by:
handleEndReceivingStateTransferin interfaceBackupReceiver
-
handleStateTransferState
public CompletionStage<Void> handleStateTransferState(XSiteStatePushCommand cmd)
Description copied from interface:BackupReceiverIt handles the state transfer state from a remote site. It is possible to have a single node applying the state or forward the state to respective primary owners.- Specified by:
handleStateTransferStatein interfaceBackupReceiver
-
handleRemoteCommand
public final CompletionStage<Void> handleRemoteCommand(VisitableCommand command, boolean preserveOrder)
- Specified by:
handleRemoteCommandin interfaceBackupReceiver
-
putKeyValue
public CompletionStage<Void> putKeyValue(Object key, Object value, Metadata metadata, IracMetadata iracMetadata)
Description copied from interface:BackupReceiverUpdates the key with the value from a remote site.If a conflict occurs, the update can be discarded.
- Specified by:
putKeyValuein interfaceBackupReceiver- Parameters:
key- The key to update.value- The new value.metadata- The newMetadata.iracMetadata- TheIracMetadatafor conflict resolution.- Returns:
- A
CompletionStagethat is completed when the update is apply in the cluster or is discarded.
-
removeKey
public CompletionStage<Void> removeKey(Object key, IracMetadata iracMetadata)
Description copied from interface:BackupReceiverDeletes the key.This is a request from the remote site and the removal can be discarded if a conflict happens.
- Specified by:
removeKeyin interfaceBackupReceiver- Parameters:
key- The key to delete.iracMetadata- TheIracMetadatafor conflict resolution.- Returns:
- A
CompletionStagethat is completed when the key is deleted or it is discarded.
-
clearKeys
public CompletionStage<Void> clearKeys()
Description copied from interface:BackupReceiverClears the cache.This is not safe and it doesn't perform any conflict resolution.
- Specified by:
clearKeysin interfaceBackupReceiver- Returns:
- A
CompletionStagethat is completed when the cache is cleared.
-
forwardToPrimary
public CompletionStage<Void> forwardToPrimary(IracUpdateKeyCommand command)
Description copied from interface:BackupReceiverForwards theIracUpdateKeyCommandto the primary owner.- Specified by:
forwardToPrimaryin interfaceBackupReceiver- Parameters:
command- TheIracUpdateKeyCommandto forward.- Returns:
- A
CompletionStagethat is completed when the primary owner completes the request.
-
-