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:
- Remove old {@link FileVersion} and their corresponding database entities.In particular, it also removes {@link PartialFileHistory}s, {@link FileContent}s, {@link Chunk}s and {@link MultiChunk}s.
- 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
Write and upload old versions to PRUNE file
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.
@author Philipp C. Heckel