The rbtree was replaced by a std::map.
This commit is contained in:
Jocelyn Turcotte 2017-09-15 12:35:40 +02:00 коммит произвёл Roeland Jago Douma
Родитель cda72effe2
Коммит dc3c3195b5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F941078878347C0C
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -34,7 +34,7 @@ The discovery phase collects file and directory metadata from the local and remo
Afterwards, we have two trees that tell us what happened relative to the journal. But there may still be conflicts if something happened to an entity both locally and on the remote.
- Input: file system, server data, journal
- Output: two c_rbtree_t*, representing the local and remote trees
- Output: two FileMap (std::map<QByteArray, std::unique_ptr<csync_file_stat_t>>), representing the local and remote trees
- Note on remote discovery: Since a change to a file on the server causes the etags of all parent folders to change, folders with an unchanged etag can be read from the journal directly and don't need to be walked into.
@ -52,12 +52,12 @@ The reconcile phase compares and adjusts the local and remote trees (in both dir
Afterwards, there are still two trees, but conflicts are marked in them.
- Input: c_rbtree_t* for the local and remote trees, journal (for some rename-related queries)
- Output: changes c_rbtree_t* in-place
- Input: FileMap for the local and remote trees, journal (for some rename-related queries)
- Output: changes FileMap in-place
- Details
- csync_reconcile() runs csync_reconcile_updates() for the local and remote trees, one after the other.
- csync_reconcile_updates() uses c_rbtree_walk() to iterate through the entries, calling _csync_merge_algorithm_visitor() for each.
- csync_reconcile_updates() iterates through the entries, calling _csync_merge_algorithm_visitor() for each.
- _csync_merge_algorithm_visitor() checks whether the other tree also has an entry for that node and merges the actions, detecting conflicts. This is the main function of this pass.
@ -67,7 +67,7 @@ The post-reconcile phase merges the two trees into one set of SyncFileItems.
Afterwards, there is a list of items that can tell the propagator what needs to be done.
- Input: c_rbtree_t* for the local and remote trees
- Input: FileMap for the local and remote trees
- Output: QMap<QString, SyncFileItemPtr>
- Note that some "propagations", specifically cheap metadata-only updates, are already done at this stage.