Package org.syncany.operations.up
Class Indexer
- java.lang.Object
-
- org.syncany.operations.up.Indexer
-
public class Indexer extends java.lang.Object
The indexer combines the chunking process with the corresponding database lookups for the resulting chunks. It implements the deduplication mechanism of Syncany.The class takes a list of files as input and uses the
Deduperto break these files into individual chunks. By implementing theDeduperListener, it reacts on chunking events and creates a new database version (with the newly added/changed/removed files. This functionality is entirely implemented by the index() method.The class uses the currently loaded
MemoryDatabaseas well as a potential dirty database into account. Lookups for chunks and file histories are performed on both databases.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidindex(java.util.List<java.io.File> files, java.util.List<java.io.File> deletedFiles, java.util.Queue<DatabaseVersion> databaseVersionQueue)This method implements the index/deduplication functionality of Syncany.
-
-
-
Method Detail
-
index
public void index(java.util.List<java.io.File> files, java.util.List<java.io.File> deletedFiles, java.util.Queue<DatabaseVersion> databaseVersionQueue) throws java.io.IOException
This method implements the index/deduplication functionality of Syncany. It uses aDeduperto break files down, compares them to the local database and creates a newDatabaseVersionas a result.Depending on what has changed, the new database version will contain new instances of
PartialFileHistory,FileVersion,FileContent,ChunkEntryandMultiChunkEntry.- Parameters:
files- List of files to be deduplicateddeletedFiles- List of files that have been deleteddatabaseVersionQueue- Queue to which created databaseVersions are offered- Throws:
java.io.IOException- If the chunking/deduplication cannot read/process any of the files
-
-