public abstract class AbstractLocalClusterOperationData extends Object implements DataConflictOperation
ISpaceProxy
instance
for executing the operations against the local cluster.
Batch supported operations will merged together in order to gain better performance by using
writeMultiple etc..DataConflictOperation.OperationType
Modifier and Type | Field and Description |
---|---|
protected boolean |
_aborted |
protected ConflictCause |
_conflictCause |
protected List<AbstractLocalClusterOperationData> |
_pendingOperations |
protected ConflictCause |
_previousConflictCause
After each execution the execution result is reset.
|
protected int |
_retriesCount |
protected ISpaceProxy |
_spaceProxy |
Constructor and Description |
---|
AbstractLocalClusterOperationData(ISpaceProxy spaceProxy,
ITypeDesc typeDescriptor) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Determines that the operation will be aborted.
|
void |
addPendingOperation(AbstractLocalClusterOperationData operationData)
Add an
AbstractLocalClusterOperationData to the current instance (merge for
execution). |
protected ConflictCause |
convertExceptionToConflict(Throwable error) |
abstract boolean |
execute(Transaction transaction)
Executes the operation against the provided
ISpaceProxy with the provided Transaction instance. |
ConflictCause |
getConflictCause() |
String |
getResolutionDescription() |
int |
getResolveAttempt() |
protected int |
getRetriesCount() |
SpaceTypeDescriptor |
getTypeDescriptor() |
boolean |
hasConflict() |
protected void |
incrementResolveAttempt() |
protected void |
incrementRetriesCounter() |
boolean |
isAborted() |
protected boolean |
isOverriden() |
protected boolean |
isRetryable(int maximumRetries) |
boolean |
isSameOperationType(AbstractLocalClusterOperationData operationData) |
void |
override()
Determines that the operation will be overridden.
|
protected void |
overrideImpl() |
void |
reset() |
void |
setConflictCause(ConflictCause conflictCause) |
boolean |
supportsAbort() |
abstract boolean |
supportsBatching() |
boolean |
supportsGetTypeDescriptor() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getOperationEntry, getOperationType, supportsOverride
getDataAsDocument, getDataAsObject, getDataSyncOperationType, getSpaceId, getUid, supportsDataAsDocument, supportsDataAsObject, supportsGetSpaceId
protected List<AbstractLocalClusterOperationData> _pendingOperations
protected ConflictCause _conflictCause
protected boolean _aborted
protected final ISpaceProxy _spaceProxy
protected int _retriesCount
protected ConflictCause _previousConflictCause
public AbstractLocalClusterOperationData(ISpaceProxy spaceProxy, ITypeDesc typeDescriptor)
public boolean isSameOperationType(AbstractLocalClusterOperationData operationData)
AbstractLocalClusterOperationData
is of the same class
type.public void addPendingOperation(AbstractLocalClusterOperationData operationData)
AbstractLocalClusterOperationData
to the current instance (merge for
execution).operationData
- The AbstractLocalClusterOperationData
to add.public abstract boolean execute(Transaction transaction) throws Exception
ISpaceProxy
with the provided Transaction
instance.transaction
- The Transaction
to with the operations.Exception
public abstract boolean supportsBatching()
public void reset()
protected void overrideImpl()
public void override()
DataConflictOperation
DataConflictOperation.supportsOverride()
returns true. It is possible to change the operation's entry data
using the DataSyncOperation.getDataAsObject()
or DataSyncOperation.getDataAsDocument()
methods.
EntryAlreadyInSpaceConflict
will turn to an update
operation.EntryNotInSpaceConflict
will turn to a
write operation.EntryVersionConflict
will
overwrite the entry in the target space.EntryLockedUnderTransactionConflict
will be retried.override
in interface DataConflictOperation
public boolean hasConflict()
hasConflict
in interface DataConflictOperation
public void abort()
DataConflictOperation
DataConflictOperation.supportsAbort()
returns true.abort
in interface DataConflictOperation
public boolean isAborted()
protected boolean isOverriden()
protected boolean isRetryable(int maximumRetries)
protected void incrementRetriesCounter()
protected int getRetriesCount()
public int getResolveAttempt()
getResolveAttempt
in interface DataConflictOperation
protected void incrementResolveAttempt()
public ConflictCause getConflictCause()
getConflictCause
in interface DataConflictOperation
ConflictCause
instance representing the conflict.public void setConflictCause(ConflictCause conflictCause)
protected ConflictCause convertExceptionToConflict(Throwable error)
public boolean supportsAbort()
supportsAbort
in interface DataConflictOperation
public String getResolutionDescription()
public SpaceTypeDescriptor getTypeDescriptor()
getTypeDescriptor
in interface DataSyncOperation
DataSyncOperation.supportsGetTypeDescriptor()
return true, otherwise an exception will be thrown.public boolean supportsGetTypeDescriptor()
supportsGetTypeDescriptor
in interface DataSyncOperation
DataSyncOperation.getTypeDescriptor()
operation.Copyright © GigaSpaces.