Top Description Fields Constructors Methods
net.sf.ehcache.writer.writebehind.operations

public Class DeleteOperation

extends Object
implements SingleOperation
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.writer.writebehind.operations.SingleOperation, net.sf.ehcache.writer.writebehind.operations.KeyBasedOperation
Imports
net.sf.ehcache.CacheEntry, .Element, net.sf.ehcache.writer.CacheWriter, java.util.ArrayList, .List

Implements the delete operation for write behind
Author
Geert Bevin
Version
$Id: DeleteOperation.java 10029 2015-10-07 18:57:27Z cdennis $

Field Summary

Modifier and TypeField and Description
private final long
private final CacheEntry

Constructor Summary

AccessConstructor and Description
public
DeleteOperation(CacheEntry
the entry to delete
entry
)

Create a new delete operation for a particular entry

public
DeleteOperation(CacheEntry
the entry to delete
entry
,
long
the creation time of the operation
creationTime
)

Create a new delete operation for a particular entry and creation time

Method Summary

Modifier and TypeMethod and Description
public BatchOperation
createBatchOperation(List<? extends SingleOperation>
the single operations that need to be regrouped in the batch operation
operations
)

Implements net.sf.ehcache.writer.writebehind.operations.SingleOperation.createBatchOperation.

Creates a batch operation that corresponds to the operation type of this single operation.
private CacheEntry
public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public long
getCreationTime()

Implements net.sf.ehcache.writer.writebehind.operations.KeyBasedOperation.getCreationTime.

Retrieves the moment when the operation was created.
public CacheEntry
getEntry()

Retrieves the entry that will be used for this operation

public Object
getKey()

Implements net.sf.ehcache.writer.writebehind.operations.KeyBasedOperation.getKey.

Retrieves the element key for this operation.
public SingleOperationType
getType()

Implements net.sf.ehcache.writer.writebehind.operations.SingleOperation.getType.

Returns a stable identifier for the type this operation can be classified in. This is used to group and order batched operations.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public void
performSingleOperation(CacheWriter
the cache writer this operation should be performed upon
cacheWriter
)

Implements net.sf.ehcache.writer.writebehind.operations.SingleOperation.performSingleOperation.

Perform this operation as a single execution with the provided cache writer
public void
throwAway(final CacheWriter
the CacheWriter to delegate to
cacheWriter
,
final RuntimeException
the last exception encountered
e
)

Implements net.sf.ehcache.writer.writebehind.operations.SingleOperation.throwAway.

Called when all retries have failed
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

creationTimeback to summary
private final long creationTime
entryback to summary
private final CacheEntry entry

Constructor Detail

DeleteOperationback to summary
public DeleteOperation(CacheEntry entry)

Create a new delete operation for a particular entry

Parameters
entry:CacheEntry

the entry to delete

DeleteOperationback to summary
public DeleteOperation(CacheEntry entry, long creationTime)

Create a new delete operation for a particular entry and creation time

Parameters
entry:CacheEntry

the entry to delete

creationTime:long

the creation time of the operation

Method Detail

createBatchOperationback to summary
public BatchOperation createBatchOperation(List<? extends SingleOperation> operations)

Implements net.sf.ehcache.writer.writebehind.operations.SingleOperation.createBatchOperation.

Doc from net.sf.ehcache.writer.writebehind.operations.SingleOperation.createBatchOperation.

Creates a batch operation that corresponds to the operation type of this single operation.

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.

Parameters
operations:List<? extends SingleOperation>

the single operations that need to be regrouped in the batch operation

Returns:BatchOperation

the created batch operation

duplicateCacheEntryElementback to summary
private CacheEntry duplicateCacheEntryElement(CacheEntry entry)
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getCreationTimeback to summary
public long getCreationTime()

Implements net.sf.ehcache.writer.writebehind.operations.KeyBasedOperation.getCreationTime.

Doc from net.sf.ehcache.writer.writebehind.operations.KeyBasedOperation.getCreationTime.

Retrieves the moment when the operation was created.

Returns:long

the creation time in milliseconds

getEntryback to summary
public CacheEntry getEntry()

Retrieves the entry that will be used for this operation

getKeyback to summary
public Object getKey()

Implements net.sf.ehcache.writer.writebehind.operations.KeyBasedOperation.getKey.

Doc from net.sf.ehcache.writer.writebehind.operations.KeyBasedOperation.getKey.

Retrieves the element key for this operation.

Returns:Object

the key of the element that is concerned by the operation.

getTypeback to summary
public SingleOperationType getType()

Implements net.sf.ehcache.writer.writebehind.operations.SingleOperation.getType.

Doc from net.sf.ehcache.writer.writebehind.operations.SingleOperation.getType.

Returns a stable identifier for the type this operation can be classified in. This is used to group and order batched operations.

Returns:SingleOperationType

the identifier for this operation type

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

performSingleOperationback to summary
public void performSingleOperation(CacheWriter cacheWriter)

Implements net.sf.ehcache.writer.writebehind.operations.SingleOperation.performSingleOperation.

Doc from net.sf.ehcache.writer.writebehind.operations.SingleOperation.performSingleOperation.

Perform this operation as a single execution with the provided cache writer

Parameters
cacheWriter:CacheWriter

the cache writer this operation should be performed upon

throwAwayback to summary
public void throwAway(final CacheWriter cacheWriter, final RuntimeException e)

Implements net.sf.ehcache.writer.writebehind.operations.SingleOperation.throwAway.

Doc from net.sf.ehcache.writer.writebehind.operations.SingleOperation.throwAway.

Called when all retries have failed

Parameters
cacheWriter:CacheWriter

the CacheWriter to delegate to

e:RuntimeException

the last exception encountered