mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Created File Change Data Capture (markdown)
parent
d078528578
commit
57d99b9aa4
19
File-Change-Data-Capture.md
Normal file
19
File-Change-Data-Capture.md
Normal file
|
@ -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
|
Loading…
Reference in a new issue