Skip to content

Commit

Permalink
Add initial implementation of streamChangesSinceV2
Browse files Browse the repository at this point in the history
Summary:
# Context

We are introducing EdenFS notifications to support scalable and ergonomic file system notifications for EdenFS mounts.

# This Diff

This diff tweaks the Thrift API a bit - reorganizing, renaming and adding some types. Additionally, it adds an initial, partially correct, implementation of this API. The current implementation returns changes in ordered buckets (filesystem followed by commits). It also doesn't capture all of the changes nore the dtypes. Subsequent diffs will get to these.

# Technical Details

Code is mostly a copy-paste from `streamChangesSince`, replacing API types where needed. Changes are around the processing of overlay and snapshot changes to now return the new API change events.

# Discussion Points

None

Differential Revision: D65625598

fbshipit-source-id: 5151473ab7237c8ac792ab59ccd41d4f070204d9
  • Loading branch information
jdelliot authored and facebook-github-bot committed Nov 9, 2024
1 parent 08e51e4 commit 828be72
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions eden/fs/service/streamingeden.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ const i64 FS_EVENT_READ = 1;
const i64 FS_EVENT_WRITE = 2;
const i64 FS_EVENT_OTHER = 4;

struct CommitTransition {
1: eden.ThriftRootId from;
2: eden.ThriftRootId to;
struct Added {
1: eden.Dtype fileType;
3: eden.PathString path;
}

struct DirectoryRenamed {
1: eden.PathString from;
2: eden.PathString to;
struct Modified {
1: eden.Dtype fileType;
3: eden.PathString path;
}

struct Renamed {
Expand All @@ -78,26 +78,35 @@ struct Renamed {
3: eden.PathString to;
}

struct Added {
struct Replaced {
1: eden.Dtype fileType;
3: eden.PathString path;
2: eden.PathString from;
3: eden.PathString to;
}

struct Deleted {
struct Removed {
1: eden.Dtype fileType;
3: eden.PathString path;
}

struct Modified {
1: eden.Dtype fileType;
3: eden.PathString path;
union SmallChangeNotification {
// @lint-ignore-every FBTHRIFTCOMPAT FBTHRIFTCOMPAT1 FBTHRIFTCOMPAT2
1: Added added;
// @lint-ignore-every FBTHRIFTCOMPAT FBTHRIFTCOMPAT1 FBTHRIFTCOMPAT2
2: Modified modified;
// @lint-ignore-every FBTHRIFTCOMPAT FBTHRIFTCOMPAT1 FBTHRIFTCOMPAT2
3: Renamed renamed;
4: Replaced replaced;
5: Removed removed;
}

union SmallChangeNotification {
1: Renamed renamed;
2: Added added;
3: Deleted deleted;
4: Modified modified;
struct DirectoryRenamed {
1: eden.PathString from;
2: eden.PathString to;
}
struct CommitTransition {
1: eden.ThriftRootId from;
2: eden.ThriftRootId to;
}

union LargeChangeNotification {
Expand Down

0 comments on commit 828be72

Please sign in to comment.