Class DeleteOperation

    • Constructor Detail

      • DeleteOperation

        public DeleteOperation​(CacheEntry entry)
        Create a new delete operation for a particular entry
        Parameters:
        entry - the entry to delete
      • DeleteOperation

        public DeleteOperation​(CacheEntry entry,
                               long creationTime)
        Create a new delete operation for a particular entry and creation time
        Parameters:
        entry - the entry to delete
        creationTime - the creation time of the operation
    • Method Detail

      • performSingleOperation

        public void performSingleOperation​(CacheWriter cacheWriter)
        Perform this operation as a single execution with the provided cache writer
        Specified by:
        performSingleOperation in interface SingleOperation
        Parameters:
        cacheWriter - the cache writer this operation should be performed upon
      • createBatchOperation

        public BatchOperation createBatchOperation​(java.util.List<? extends SingleOperation> operations)
        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.

        Specified by:
        createBatchOperation in interface SingleOperation
        Parameters:
        operations - the single operations that need to be regrouped in the batch operation
        Returns:
        the created batch operation
      • getKey

        public java.lang.Object getKey()
        Retrieves the element key for this operation.
        Specified by:
        getKey in interface KeyBasedOperation
        Returns:
        the key of the element that is concerned by the operation.
      • getCreationTime

        public long getCreationTime()
        Retrieves the moment when the operation was created.
        Specified by:
        getCreationTime in interface KeyBasedOperation
        Returns:
        the creation time in milliseconds
      • getEntry

        public CacheEntry getEntry()
        Retrieves the entry that will be used for this operation
      • getType

        public SingleOperationType getType()
        Returns a stable identifier for the type this operation can be classified in. This is used to group and order batched operations.
        Specified by:
        getType in interface SingleOperation
        Returns:
        the identifier for this operation type
      • throwAway

        public void throwAway​(CacheWriter cacheWriter,
                              java.lang.RuntimeException e)
        Called when all retries have failed
        Specified by:
        throwAway in interface SingleOperation
        Parameters:
        cacheWriter - the CacheWriter to delegate to
        e - the last exception encountered
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object