-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
-
DataGrid Sprint #44, DataGrid Sprint #45, DataGrid Sprint #46, DataGrid Sprint #47, DataGrid Sprint #48
A conflict happens if 2 sites try to update the same key (put/remove) concurrently.
With async Cross-Site Replication (aka IRAC) when a conflict is detected, we use the site name to pick the winning update.
Interface
interface ABC<V> { // or concrete class String site(); //the site name which wrote this value V value(); // the value. can be null if the key was removed Metadata metadata(); //can be null } interface Resolve<K, V> { ABC<V> resolve(K key, ABC<V> entry1, ABC<V> entry2); }
Configuration
Set the class name to use. Can be a Class object (as shown above) or a String with the class name.
For server mode, you need to add your jar with the classes required to server/lib.
The configuration fails to validate if the conflict resolution class is set with SYNC strategy.
ConfigurationBuilder.sites().addBackup()
.site("S")
.strategy(BackupConfiguration.BackupStrategy.ASYNC)
.conflictResolution(MyResover.class);