I'm working on a file-synchronization client that currently produces a stream of changes to the underlying filesystem. That is a stream of create/update/move/delete events is produced for each synchronization "target".
Each event includes a sequence-ID, which provides information about the ordering of events, and then information such as:
- source path (& destination path for move events)
- md5 (for files)
- mtime timestamp
- event type : {create, move, update, delete}
This works reasonably well, but there are often redundancies. For example, a move from path X to path Y and then back to path X will be reported as two events:
- X -> Y
- Y -> X
This is clearly redundant, and can be removed altogether from the stream.
Are there any well-documented techniques for detecting and removing such redundancies?
Similarly, is there a well-understood and efficient way to detect redundancies stemming from deletions? For example:
- Update A
- A -> B
- B -> C
- Delete C
Here, changes 1 - 4 could be reduced to Delete A
.
Informal approaches, along with academic papers would be most welcome, bearing in mind that it's not uncommon to encounter streams of tens of thousands of events in this case.
Many thanks!
EDIT
Does this problem have a name? The reason I'm here is because google has failed me, and I'm guessing this is because I'm missing some vocabulary!
Does this problem have a name?
, not sure about exact term, but tools such asgit
do something similar.