Class CleanupOperation


  • public class CleanupOperation
    extends AbstractTransferOperation
    The purpose of the cleanup operation is to keep the local database and the remote repository clean -- thereby allowing it to be used indefinitely without any performance issues or storage shortage.

    The responsibilities of the cleanup operations include:

    High level strategy:

    • Lock repo and start thread that renews the lock every X seconds
    • Find old versions / contents / ... from database
    • Delete these versions and contents locally
    • Delete all remote metadata
    • Obtain consistent database files from local database
    • Upload new database files to repo
    • Remotely delete unused multichunks
    • Stop lock renewal thread and unlock repo

    Important issues: All remote operations MUST check if the lock has been recently renewed. If it hasn't, the connection has been lost.

    • Method Detail

      • execute

        public CleanupOperationResult execute()
                                       throws java.lang.Exception
        Description copied from class: Operation
        Executes the operation synchronously and returns a result when the operation exits. Using covariance is recommend, that is OperationFoo should override execute so as to return a OperationFooResult rather than OperationResult.
        Specified by:
        execute in class Operation
        Returns:
        Returns an operation-specific operation result
        Throws:
        java.lang.Exception - If the operation fails