public class CleanupOperation extends AbstractTransferOperationThe 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:
- Remove old
FileVersionand their corresponding database entities. In particular, it also removes
- Merge metadata of a single client and remove old database version files from the remote storage.
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.
- Remove old
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
execute()Executes the operation synchronously and returns a result when the operation exits.
Methods inherited from class org.syncany.operations.AbstractTransferOperation
finishOperation, getLastRemoteCleanupNumber, getNewestDatabaseFileVersion, otherRemoteOperationsRunning, startOperation
public CleanupOperationResult execute() throws java.lang.ExceptionDescription copied from class:
OperationExecutes 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.