Interface BackupEntryProcessor<K,V>
- Type Parameters:
K- the type of the keyV- the type of the value
public interface BackupEntryProcessor<K,V>
Processor for updates that run on backup replicas
after the primary processor completes.
BackupEntryProcessor ensures that backup entries stay in sync when processors modify entries on the primary. This is critical for consistency in distributed environments where replicas need to reflect the same changes as the primary.
Implementations should be idempotent, as they may be executed multiple times if the primary processor runs multiple times due to retries or retransmissions.
Usage:
BackupEntryProcessorinvalid input: '<'String, Integer> backupUpdater = entry -> {
// Update backup replica with the same changes
int value = entry.value() != null ? entry.value() : 0;
entry.setValue(value + 1);
};
-
Method Summary
Modifier and TypeMethodDescriptionvoidprocessBackup(CacheEntryProcessor.Entry<K, V> entry) Process the backup entry with the same modifications as the primary.
-
Method Details
-
processBackup
Process the backup entry with the same modifications as the primary.This method is called on the backup replica after the primary processor has successfully completed. Implementations should apply the same changes to the backup entry as were applied to the primary.
- Parameters:
entry- the mutable entry to update on the backup (must not be null)
-