public class DeleteOperation extends java.lang.Object implements SingleOperation
Modifier and Type | Field and Description |
---|---|
private long |
creationTime |
private CacheEntry |
entry |
Constructor and Description |
---|
DeleteOperation(CacheEntry entry)
Create a new delete operation for a particular entry
|
DeleteOperation(CacheEntry entry,
long creationTime)
Create a new delete operation for a particular entry and creation time
|
Modifier and Type | Method and Description |
---|---|
BatchOperation |
createBatchOperation(java.util.List<SingleOperation> operations)
Creates a batch operation that corresponds to the operation type of this single operation.
|
private CacheEntry |
duplicateCacheEntryElement(CacheEntry entry) |
boolean |
equals(java.lang.Object other) |
long |
getCreationTime()
Retrieves the moment when the operation was created.
|
CacheEntry |
getEntry()
Retrieves the entry that will be used for this operation
|
java.lang.Object |
getKey()
Retrieves the element key for this operation.
|
SingleOperationType |
getType()
Returns a stable identifier for the type this operation can be classified in.
|
int |
hashCode() |
void |
performSingleOperation(CacheWriter cacheWriter)
Perform this operation as a single execution with the provided cache writer
|
void |
throwAway(CacheWriter cacheWriter,
java.lang.RuntimeException e)
Called when all retries have failed
|
private final CacheEntry entry
private final long creationTime
public DeleteOperation(CacheEntry entry)
entry
- the entry to deletepublic DeleteOperation(CacheEntry entry, long creationTime)
entry
- the entry to deletecreationTime
- the creation time of the operationprivate CacheEntry duplicateCacheEntryElement(CacheEntry entry)
public void performSingleOperation(CacheWriter cacheWriter)
performSingleOperation
in interface SingleOperation
cacheWriter
- the cache writer this operation should be performed uponpublic BatchOperation createBatchOperation(java.util.List<SingleOperation> operations)
CacheWriter
that will be used to execute the batch operation.createBatchOperation
in interface SingleOperation
operations
- the single operations that need to be regrouped in the batch operationpublic java.lang.Object getKey()
getKey
in interface KeyBasedOperation
public long getCreationTime()
getCreationTime
in interface KeyBasedOperation
public CacheEntry getEntry()
public SingleOperationType getType()
getType
in interface SingleOperation
public void throwAway(CacheWriter cacheWriter, java.lang.RuntimeException e)
throwAway
in interface SingleOperation
cacheWriter
- the CacheWriter to delegate toe
- the last exception encounteredpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object