public class UpOperation extends AbstractTransferOperationThe up operation implements a central part of Syncany's business logic. It analyzes the local folder, deduplicates new or changed files and uploads newly packed multichunks to the remote storage. The up operation is the complement to the
The general operation flow is as follows:
- Load local database (if not already loaded)
- Analyze local directory using the
StatusOperationto determine any changed/new/deleted files
- Determine if there are unknown remote databases using the
LsRemoteOperation, and skip the rest if there are
- If there are changes, use the
Indexerto create a new
DatabaseVersion(including new chunks, multichunks, file contents and file versions).
- Upload new multichunks (if any) using a
- Save new
DatabaseVersionto a new (delta)
MemoryDatabaseand upload it
- Add delta database to local database and store it locally
UpOperationOptions. If a sequence of transactions is interrupted, all queued transactions are written to disk to be resumed later. The next up operation then reads these transactions and resumes them in the same order as they were queued before the interruption.
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
execute()Executes the operation synchronously and returns a result when the operation exits.
saveDeltaDatabase(MemoryDatabase db, java.io.File localDatabaseFile)Serializes a
MemoryDatabaseto a file, using the configured transformer.
Methods inherited from class org.syncany.operations.AbstractTransferOperation
finishOperation, getLastRemoteCleanupNumber, getNewestDatabaseFileVersion, otherRemoteOperationsRunning, startOperation
public UpOperationResult 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.