Created File Change Data Capture (markdown)

Chris Lu 2020-11-13 12:59:59 -08:00
parent d078528578
commit 57d99b9aa4

@ -0,0 +1,19 @@
Is it too much a dream to have something similar to [inotify](https://man7.org/linux/man-pages/man7/inotify.7.html) in a distributed file system? Not really!
Actually SeaweedFS can give you more!
Here is an example, in Java:
https://github.com/chrislusf/seaweedfs/blob/master/other/java/examples/src/main/java/com/seaweedfs/examples/WatchFiles.java
Basically there are four types of events to handle:
| Type | Directory | NewEntry | OldEntry | NewParentPath |
| -------| -------| -------| -------| -------|
| Create | exists | exists | null | equal to Directory |
| Update | exists | exists | exists | equal to Directory |
| Delete | exists | null | exists | equal to Directory |
| Rename | exists | exists | exists | not equal to Directory |
This is based on Filer gRPC API. You should be able to easily implement it in your own language.
https://github.com/chrislusf/seaweedfs/blob/master/weed/pb/filer.proto#L52