Interface DataConflict
- All Known Implementing Classes:
LocalClusterReplicationDataConflict
public interface DataConflict
Provides an interface for resolving data conflicts.
A data conflict is a conflict caused by
write/update/take operations.
The relevant conflicts are:
-
EntryAlreadyInSpaceConflict- An attempt to write a new entry which already exists. -
EntryNotInSpaceConflict- An attempt to update an existing entry which doesn't exist. -
EntryLockedUnderTransactionConflict- An attempt to update an entry which is locked under transaction. -
EntryVersionConflict- An attempt to update an entry with a newer/older version than the existing one.
- Since:
- 8.0.3
- Author:
- eitany
-
Method Summary
Modifier and TypeMethodDescriptionvoidabortAll()Indicates that all of the operations associated with theDataConflictwill be aborted.Gets all the conflicted operations, for a non transactional conflict, this will contain a single operation that causes the conflict.voidIndicates that all of the operations associated with theDataConflictwill be overridden.
-
Method Details
-
getOperations
DataConflictOperation[] getOperations()Gets all the conflicted operations, for a non transactional conflict, this will contain a single operation that causes the conflict. If theDataConflictinstance represents a transaction conflict, all of the operation under the transaction are returned, even operations that did not cause any conflict.- Returns:
- The operations associated with the conflict.
-
abortAll
void abortAll()Indicates that all of the operations associated with theDataConflictwill be aborted. This is equivalent to iterating over all the operations and callingDataConflictOperation.abort()on each one. -
overrideAll
void overrideAll()Indicates that all of the operations associated with theDataConflictwill be overridden. This is equivalent to iterating over all the operations and callingDataConflictOperation.override()on each one.Each operation has a different logic when it gets overridden depends on the conflict that occurred (refer to
DataConflictOperation.override()for more information}.
-