public class WriteOperation extends Object implements SingleOperation
| Constructor and Description |
|---|
WriteOperation(Element element)
Create a new write operation for a particular element
|
WriteOperation(Element element,
long creationTime)
Create a new write operation for a particular element and creation time
|
| Modifier and Type | Method and Description |
|---|---|
BatchOperation |
createBatchOperation(List<? extends SingleOperation> operations)
Creates a batch operation that corresponds to the operation type of this single operation.
|
boolean |
equals(Object other) |
long |
getCreationTime()
Retrieves the moment when the operation was created.
|
Element |
getElement()
Retrieves the element that will be used for this operation
|
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,
RuntimeException e)
Called when all retries have failed
|
public WriteOperation(Element element)
element - the element to writepublic WriteOperation(Element element, long creationTime)
element - the element to writecreationTime - the creation time of the operationpublic void performSingleOperation(CacheWriter cacheWriter)
performSingleOperation in interface SingleOperationcacheWriter - the cache writer this operation should be performed uponpublic BatchOperation createBatchOperation(List<? extends SingleOperation> operations)
This batch operation will not be stored in the queue anymore and is solely used for structuring.
The data from the single operation will already be processed in the final form that will be expected by the
CacheWriter that will be used to execute the batch operation.
createBatchOperation in interface SingleOperationoperations - the single operations that need to be regrouped in the batch operationpublic Object getKey()
getKey in interface KeyBasedOperationpublic long getCreationTime()
getCreationTime in interface KeyBasedOperationpublic Element getElement()
public SingleOperationType getType()
getType in interface SingleOperationpublic void throwAway(CacheWriter cacheWriter, RuntimeException e)
throwAway in interface SingleOperationcacheWriter - the CacheWriter to delegate toe - the last exception encounteredCopyright 2001-2021, Terracotta, Inc.