Interface OnCleanupTask


  • public interface OnCleanupTask
    This task allows us to essentially implement ON DELETE CASCADE.

    If we have an index that marks usage of a shared resource effectively reference counting this resource, then this task can be used to see if all references are gone and remove the resource that is no longer needed.

    The original intent of this was to clean up shared streams when doing a hard delete of media that used these shared streams.

    • Method Detail

      • cellsCleanedUp

        boolean cellsCleanedUp​(Transaction transaction,
                               Set<Cell> cells)
        This method is run in a fresh transaction before a cell is cleaned up. This method has an opportunity to use the fresh transaction to make decisions about what else needs to be cleaned up.

        This method may be called for uncommited cells or old cells with new values.

        If the current transaction fills up this method should return true and it will be called again with a fresh transaction. This is useful if a large cleanup is needed.

        Returns:
        true if this method should be called again with a fresh transaction